Java

Search for question

Questions & Answers

13. Write a code that randomly selects a card and prints it on the screen. { Create a string array with "Clubs", "Diamonds", "Hearts", "Spades"} and { "2", "3", "4", "5", "6", ",", "8", "9", "10", "Jack", "Queen", "King", and "Ace"} and write code to randomly select 5 cards from them.


Write a program that asks a user to guess a secret number between 1 and N, where N is a positive number that the user is prompted for. The program should also prompt the user for the maximum number of guesses they would like to make. Each time the player makes a guess, the program shall respond with "correct", "too low", or "too high". The program should keep track of the number of guesses the user made to discover the secret number. The program should continue execution until the user has discovered the secret number or has exceeded the maximum number of guesses. The program shall also allow the user to play the game again until the user declines. The program should generate the magic number randomly, using the built-in Java method Math.random(). To generate a random number between 1 and N, the following formula may be used: randomNumber = (int) ( N * Math.random() ) + 1 Submit the source code for each program, and a screen capture of each program's output, in a zip file named as follows: Assignment3, followed by an underscore (), followed by your first name initial, followed by your last name. For example, if your name is Jane Smith your zip file would be Assignment3_jsmith.zip. Please be sure to comment your source code.


Write a program that prompts the user to enter the maximum number of asterisks (*) to display on a line of output, as well as a choice of two different output patterns. The program shall then display the asterisks according to one of the patterns below. For example, if the user specifies 10 as the maximum number of asterisks, the output should look like one of the following:


2. Write a program that asks the user to enter five baseball player batting averages (example: Best Avg. in 2019 .338 and Worst Average is .202). Once the user types in the five batting averages,calculate the average of all five batting averages in order to get the Average of the 5 players. The program should then display the following messages about the average. Assume three place values only.


1. Write a program that calculates the amount a person would earn over a period of time if his or her salary is one dime the first day,two dimes the second day, and continues to double each day. The program should display a table showing the salary for each day,and then show the total pay at the end of the period. The output should be displayed in a dollar amount, not the number of pennies.


MATLAB will not recognize a for loop if the body of code inside it is not indented. a. True b. False


a) Complete the table with bit value of D and C b) If the bit stream user received has been changed to "10110001", please show how hamming encoding can detect it and find the position? Please use the review slide to demonstrate.


Consider a magnetic disk drive with 8 surfaces, 512 tracks/surface, and 64 sectors/track.Sector size is 1 kB. The average seek time is 8 ms, the track-to-track access time is 1.5 ms,and the drive rotates at 3600 rpm. Successive tracks in a cylinder can be read without headmovement. Show your work to receive full credit. . What is the disk capacity? b. What is the average access time in milliseconds? Assume this file is stored in successive sectors and tracks of successive cylinders, startingat sector 0, track 0, of cylinder i.


4. Write programs: a. Write a program to display the following messages in the console: "Welcome to Java World", "I like programming", and "I am a student at Suffolk Community College" b. Write a program to' display the following pattern:


Question 1: Given that you don't have any other data structures (array or linked list) for queue implementation: Discuss how to implement queue data structure using stack. 2, How many stacks are needed to implement a queue? 3. Given the Stack Interface and the Linked Stack classes, write a Java code to create queue using stack. Test your code by creating a queue Number that takes N numbers to enqueue and then dequeue and print them the numbers on the screen. 4. What is the complexity of queue implementation using stack. 5. Is it possible to implement the stack data structure using queue? Justify youranswer.


No Question Found forJava

we will make sure available to you as soon as possible.