Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pls make an outline don't copy and paste from other chegg answer pls. ty Programming Assignment 1 Fundamentals of Computing (CSCI 1410) For this programming

image text in transcribed

image text in transcribed

image text in transcribed

pls make an outline don't copy and paste from other chegg answer pls. ty

Programming Assignment 1 Fundamentals of Computing (CSCI 1410) For this programming assignment you will use cout while loops, for loops, if statements (and for extra credit switch statements and reading in from a file) Programming Assignment 1 Outline (10 points) Create an outline in plain English using individual line comments. Make sure to indent. If something is associated with a loop for example you would say //loop until ... //step 1 //step 2 Programming Assignment 1 (40 points) For this assignment you will be creating a menu that gives the choice of two "magic" math formulas. You will be declaring variables, using while loops, for loops and if statements, ta out values. There will be a lot of curly brackets so make sure you properly indent AND comment each closing curly bracket with line comments noting which statement it is closing. Also remember that if you have more than one statement, you MUST use curly brackets. Finally, do a little at a time ues as you go along. Test your for loops with just a couple of values that you can manually compute. Test your menu first with just simple print statements when you choose a menu number. See an abbreviated example below to give you an idea of how your output should look. When your program starts it should print out your name and student ID. Then display a menu with 3 options. 1. Almost Always 99 2. Always 3 3. Exit If the user presses 1: A. Use print (cout) statements to show every mathematical step. B. For Every number from 0 to (and including) 99 do the following: o f the number (first) is less than 10, multiply it by 10. o Break the two digit number into a tens digit and a ones digit . (Remember that an integer / integer results in an truncated integer, not rounded up or down) . For example 26/10 = 2 (tens), 2*10 = 20,26-20 = 6 (ones) o Reverse the digits (second) (Again think of this as reversing the tens digit with the ones digit). o Subtract the second number from the first third) o If the result (third) is negative, multiple by -1. If the result (third) is less than 10, multiple it by 10. o Take the result (third), reverse the digits (fourth) o Add (third) to (fourth). C. If the answer is 99 print out a congratulations message. If not, print a message that you may have done something wrong If the user presses 2: Page 1 of 3 Programming Assignment 1 CSCI 1410 A Use print (cout) statements to show every mathematical step. B. Ask somebody to pick a number. C Double that number (B). D. Add 9 to the result (C) E Subtract 3 from that result (D). F. Divide that result (E) by 2. 6. And finally, subtract the original number. H. If the answer is 3 print out a congratulations message. If not, print a message that you may have done something wrong If the user presses 3: Give an ending message and exit out of the program If the user presses any number other than 1, 2 or 3 Go back to the top of the menu You should create a file called yourlastnamePA1.cpp (where yourlastname is your last name), test it on the csegrid by typing g++ -o pal yourlastname PA1.cpp_(that's a dash Oh, and stands for output) then if it compiles without errors ./yourlastname PA1.cpp When it is ready move it over to your PC or Mac and submit it to canvas under PA1. Extra Credit: You can get up to 10% (4 pts) extra credit for successfully a) using switch statements for your top level menu items and b) creating a 4th menu item which does the same thing as item 2. but reads information in from a file instead of from the console. For the entire program you don't have to worry about building in error checking. The user will always enter valid information and make valid choices

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions