Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me solve the following questions in Java Language only. Do not use pointers. Question 1) Program Name: CardRolljava [5] Write aprogram that plays a

Help me solve the following questions in Java Language only.

Do not use pointers.

image text in transcribedimage text in transcribed
Question 1) Program Name: CardRolljava [5] Write aprogram that plays a simple card game between the computer and the user. The program runs until user enters -50_ Each iteration ofthe loop should do the following: 0 Generate a random integer in the range of 1 through 10. This is the value ofthe computer's turn. I Ask from user an integer in the range of 1 through 10. This is the value ofthe user's turn. I The card with the lowest value wins. (In case ofa tie, there is no winner for that particular turn.) You need to validate the input if it's correct ornot. As the loop iterates, the program should keep count ofthe number oftinles the computer wins, and the number oftinles that the user Wins. After the loop performs all of its iterations, the program should display who was the grand winner, the computer or the user. Question 2) Program Name: Silicon.java [5 Points] Write a program that asks the user to enter three positive integer value; number, start, end and Silicon Value, and then prints the Silicon table of the number from the starting number to the ending number. After printing the table, our program should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate. Use a character input of y or Y to repeat, and n and N to terminate the loop. No break statement is allowed. NOTE: Perform input validation so that all numbers must be greater than 0 and the "start" number should be less than "end" number. NOTE: Silicon Number is multiplied with iteration counter as shown in the table below. Sample Output: Enter a number: 5 Enter starting value: 3 Enter ending value: 7 Enter silicon value: 9 Silicon Table: 5 * 3 * 9 = 135 5 4 18 = 360 5* 5 * 27 = 675 5 * 36 = 1080 5 * 7 * 45 = 1575 Do you want to repeat this operation again? (Press y/Y to repeat and n/N to stop) : Y Enter a number: 6 Enter starting value: 5 Enter ending value: 6 Enter silicon value: 8 Table : * 5 * 8 = 240 6 * 6 * 16 = 576 Do you want to repeat this operation again? (Press y/Y to repeat and n/N to stop) : n

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions