Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

.java Project 5: Must compile and produce results for any points! (Each of these are UP TO # points) To earn any points, the program

.java image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Project 5: Must compile and produce results for any points! (Each of these are "UP TO" # points) To earn any points, the program must compile and it must use the loops as required to repeat through code. Otherwise, the score is zero. (First point off is "free") Comments at top: (up to... 2) 1st line includes Project number and program name (.5) SHORT Program description in a sentence or two (.5) Input, Processing, and Output Descriptions ( up to .5) @name (name) AND @version (date) (up to.5) Breaks program down: (up to... 4) Includes a comment for each of these sections of code WITH blank lines between each part for readability! (up to.5) Includes a declaration section for ALL variables declarations (5) The program uses for loops as directed (Option 1 nests a for loop within a while or do while loop, Options 2 uses a for looping and a switch, Option 3 and 4 use a for loop to traverse the Strings). (3) Output matches sample output (up to... 8) including blank lines (2) spacing as shown between a prompt and input (1) spacing as shown in output (including what goes on the same line) (2) computations are correct (3) Includes an unaltered copy of a sample output below closing brace in a block comment (4) Removes leading and trailing spaces from entry by the user (1) Changes the Strings to all lower case or all upper case before comparing the letters. (1) Extra Credit: See Extra Credit below Program Expectations Program expectations: 1. Start with the "top standard comment", especially the Input, Processing, and Output to "determine your algorithm / plan of attack BEFORE you start your program! 2. THEN, start with your comments in the main method! They can be your "skeleton". Break down your programs and determine your STEPS BEFORE YOU CODE! 3. THEN, write the program, filling in the missing code between the STEP comments. Remember to leave blank lines between each section for readability. 4. Double-check your program to see if it meets all of the requirements 5. Upload the.java file to Canvas. Also include if you are done with the project and it is ready for grading, or that you are not done and will finish the project outside of class (by 10:50 AM on the day the class meets next.) - Project 5, Option 1: Coin toas simulator + Remember to include a sample run! Outer loop: Uses a while or do while loop to read in the number of tosses to generate. A NEGATIVE number ENDS this loop. Inner loop: Uses a for loop to generate zeron and ones, signifying heads or taile AND Displays them. AND Counts the number of zeros and the number of ones... Input: Ask the user for his/her name to personalize the program Ask the user for the number of zeros and ones to generate Processing: In a for loop, A. random numbers are generated B. the number of ones and zeros are counted. Output: A chart of x numbers in one row of ones and zeros is diaplayed Print out the number of heads and taila. Ends with a personalized message Gauthor your name) + version (a version number or a date) import java.uta Rondo import jathtasan public class Project 6AHeadstalle_Your LastNames public static void main (String [] args) HDeclare and initialize the variable that will store the random number // State the name of the program with your name. Then prompt and read in the user's name // Introduce the program to the user (include the user's name as part of the output): I // Top of outer loop: Prompt for and Read in a whole number // Using a for loop, generate the requested number of 1's or 0's, counting the Heads 6 Tails // Bottom of loop: (Loop ends when the user entera a negative number) // AFTER the loop is done, print out your ending message: Syaten.Qutub date("\tatsh, the exit message"). coin toss simulator. Programmer: Your name Before we begin, please enter your name: Zenia ZENIA, this program will print a chart of ones and zeros. These ones and zeros will signify heads or tails. Let's get started... Entering a NEGATIVE number will END this program! Generate how many numbers (up to 20 suggested): 20 Generating 20 numbers 1 1 1 0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 0 1 Heads = 8 Tails = 12 Entering a NEGATIVE number will END this program! Generate how many numbers (up to 20 suggested): 4 Generating 4 numbers 1 0 1 1 Heads = 1 Tails - 3 Entering a NEGATIVE number will END this program! Generate how many numbers (up to 20 suggested): 0 Generating numbers Entering a NEGATIVE number will END this program! Generate how many ambers (up to 20 suggested): -1 Thank you, ZENIA, for using Your Last Napels program

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

Step: 3

blur-text-image

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

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions

Question

a. How will the leader be selected?

Answered: 1 week ago