Need Help ?

Expert Answers

(Solved): python. need the code. thank you! . . Make sure there is no ...

python. need the code. thank you!
. . Make sure there is no syntax errors and your program produces the correct results. DO NOT forget to add the pseudocode in
. . Make sure there is no syntax errors and your program produces the correct results. DO NOT forget to add the pseudocode in Python Docstring format with the general description of problem, programmer, date, and other useful information and the line comments. REFER and FOLLOW the instructions given in Python Docstring and Python Sample Programs at Course Information Documents folder. • Make one post in the chapter lab drop box with attachments of your python codes. . Part 1: Prime Numbers A prime number is a number that is only evenly divisible by itself and I. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3. and 6. Write a Boolean function named is prime which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Use the function in a program that displays all of the prime numbers from 1 to 100. The program should have a loop that calls the is prime function. TIP: Recall that the operator divides one number by another and returns the remainder of the division. In an expression such as num1 num2, the operator will return 0 if numi is evenly divisible by num2 Save your python program as prime_numbers_yourlastname.py by replacing yourlastname with your real last name. Use the IDLE editor to write your code. Sample Output(s) is peame prim

(Solved): C++ coding . . . Description of the problem: Write a simple ...

. . . Description of the problem: Write a simple menu-driven program called Game of Guessing Cards Each card has thirteen di

You screen mens should look like the following Game of Guessing Cards (Fall 2020) EREEEEEEE EEEEEEEEE 0. Help (display rules

Hints: enum class cardPattern { 1.2.3.4. Jack, Queen}//example only To generate a random number between 1 to 13: rand() % 13

Algorithm Python program source code Sample Outputs (screenshots)


C++ coding

. . . Description of the problem: Write a simple menu-driven program called "Game of Guessing Cards Each card has thirteen different patterns. The thirteen possible patterns are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, and King This game has two cards In this game, the player can place his or her bet on any one of the several card pattern positions Available positions are Even number (prize reward is 1x) Odd number (prize reward is: 1x) Same pattern (prize rewards: 8x) Over 10 (prize rewards: 1x) 0 prize reward is. Sx) Assuming that Jack. Queen, and King are 0 For example first cards and second card - Queen then the results: . . . Rules of this game: . Initial cash for this game is specified by player - Maximum bet for each game is $500 - Minimum bet for each game is 52 Two cards are used per game a Player can place his or her betoniny one of those four card patterns for each game The winning prize is based on the specified rewards as indicated above You screen mens should look like the following Game of Guessing Cards (Fall 2020) EREEEEEEE EEEEEEEEE 0. Help (display rules for this game) Enter the total amount of money you bring in the casino for gambling 1. 2. Shuffle the cards and then place your bet here (Max. is $500, Min. is $2) 3. Check win or lose for this session only 4. Display your gambling results: • Current cash on hand • Percentage of winnings • Total number of sessions played for this game so far 9. Quit Hints: enum class cardPattern { 1.2.3.4. Jack, Queen}//example only To generate a random number between 1 to 13: rand() % 13 + 1 . Requirement: Your program must be implemented with a class called Card The class Card" should consist the following characteristics: Card() Constructor used to initialize the die. Shuffler) Used to randomly generate the face value of a die Get() Used to get the value of a card . A private member variable called cardValue with data type cardPattern. . Feel free to add any other features that you deem necessary Items to be handed in: An algorithm for this program A copy of your program C++ source code and at least one complete sample run. Algorithm Python program source code Sample Outputs (screenshots)

(Solved): . 1. Write a method to generate a random number from 10 to ...


. 1. Write a method to generate a random number from 10 to 50 and print the number after it is generated. The method name is
. 1. Write a method to generate a random number from 10 to 50 and print the number after it is generated. The method name is generateRandomNum The method returns nothing The method takes no argument The method will generate 10 random numbers in the range of 10-50 inclusive and print each random number right after it is generated. . . 2. Write a method to check if a number is even. . . The method name is isEven The method returns a boolean value . The method takes one integer argument The method will check if the number passed in is even number. If it is even number, return true, otherwise return false . HTML Editor

(Solved): a. Argue that a maximum subarray of A[1.. j+1] is either a ...

a. Argue that a maximum subarray of A[1.. j+1] is either a maximum subarray of A[1..j] or a subarray A?i.. j + 1], for some 1

a. Argue that a maximum subarray of A[1.. j+1] is either a maximum subarray of A[1..j] or a subarray A?i.. j + 1], for some 1 <i<j +1. b. Please use the above observation to develop a nonrecursive, linear-time algorithm for the maximum subarray problem.

(Solved): . (2 points) Consider the selection problem: given an array ...

. (2 points) Consider the selection problem: given an array of nnumbers (a1, a2, . . . , an) and an integer 1 ? k ? n, find thek-th smallest number in this array. A simple algorithm is to firstsort the array in O(n log n) time and then output the k-th element.In this exercise, we will try to derive an O(n) algorithm for thisproblem. Without loss of generality, we assume (a1, a2, . . . , an)are distinct and n is a power of 2. To make things easier, you aregiven access to an algorithm A which can find the median in lineartime. More specifically, for any even number t > 0, you can callalgorithm A on an array of t distinct numbers (b1, b2, . . . , bt).Algorithm A will run in time O(t) and output a number x such that|{i : bi ? x}| = t/2.

(a) Design a divide-and-conquer algorithm for the selectionproblem. Your algorithm should run in O(n) time.

(b) Prove the correctness of your algorithm and analyze itsrunning time

(Solved): === ??????? ???? ?????. ???? ????? ??????? ??? ???? ????...

=== ??????? ???? ?????. ???? ????? ??????? ??? ???? ???? ??? ??? ???????? ??????? ??? ??? ???? ??? ????? ????? ????? ?????? ?

=== ??????? ???? ?????. ???? ????? ??????? ??? ???? ???? ??? ??? ???????? ??????? ??? ??? ???? ??? ????? ????? ????? ?????? ?? ?????? ??? ???? ???????? ??? ??????? ????? ???????: 10 ???? 07 ???? (????). ???? ????? ??????? ?? ???? ???????? ??? ???? ??? ???? ??? ???? ?????? 1 ? What is the time complexity of the following below loops a. For i=0; in; i++) For(]=0; j<ij++) } Statement b. For i=1; <n; i=1+2) Stat { . . . - ?? 5 (32) Adal TTT

(Solved): CORRECT ANSWERS ONLY PLEASE a. b. Encode the following chara...

CORRECT ANSWERS ONLY PLEASE

a. b. Encode the following character sequence in UTF-8; show the resulting octets in hexadecimal: °17¢ 71+ Assume the followi

a. b. Encode the following character sequence in UTF-8; show the resulting octets in hexadecimal: °17¢ 71+ Assume the following string of octets represents an encoding in UTF-8. Decode the sequence and show which characters are meant (you may need to look up a table of characters on the internet). c2 ae e2 80 bc ce b8

(Solved): .an! Attempt 1 Question 32 (Mandatory) (10 points) Given th...


.an! Attempt 1 Question 32 (Mandatory) (10 points) Given the following and using the shortest Job Next (SJN) algorithm: Job A
.an! Attempt 1 Question 32 (Mandatory) (10 points) Given the following and using the shortest Job Next (SJN) algorithm: Job A Job B Job C Job D Job E 0 0 Arrival Time Job Time 0 0 0 8 5 1 3 6 A. Is this a preemptive or non-prememptive policy (2 pt.) B. Draw the time line to show the start and stop times of each job (6 pts.) Ex. W---------- ---- --Z 0 1 2 3 C. Computer the Average Turnaround Time for the above time line (2 pt)

(Solved): a. b. Encode the following character sequence in UTF-8; sho...

a. b. Encode the following character sequence in UTF-8; show the resulting octets in hexadecimal: °17¢ 71+ Assume the followi

a. b. Encode the following character sequence in UTF-8; show the resulting octets in hexadecimal: °17¢ 71+ Assume the following string of octets represents an encoding in UTF-8. Decode the sequence and show which characters are meant (you may need to look up a table of characters on the internet). c2 ae e2 80 bc ce b8

(Solved): . Calculate the minimax values at nodes A, B, C, and Dfor th...

. Calculate the minimax values at nodes A, B, C, and Dfor the player MAX given the game tree below. The numbers at theleaf nodes represent the values of Utility (leafnode,MAX).

B = ________.

C = ________.

D = ________.

A = ________.

MAX a1 d3 MIN bi b3 C3 d1 d3 02 d2 31 20 -2 12 8 -5 12 1 -16

MAX a1 d3 MIN bi b3 C3 d1 d3 02 d2 31 20 -2 12 8 -5 12 1 -16