Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab: 1 . Just submit this document ( See directions below. ) and insert your work after each task description. 2 . For each of

Lab:
1. Just submit this document (See directions below.) and insert your work after each task description.
2. For each of the following tasks, provide the complete pseudo code including all elements that we have been using (i.e. class, end class, main return, output prompt). Be sure to declare your variables and use symbolic constants where appropriate. Determine if each task requires a definite or indefinite loop and use the correct one. Use the do while loop for loops that you want to execute at least once, like getting input.
a. Task 1(3 pts): an application program where the user enters the price of a series of items (assume at least one.)(Prompt user for additional items until they are done, so we dont know ahead how many items there will be. This is the looping part! ;) ) The program computes shipping costs. If the total price of all items is $100 or more, then shipping is free otherwise it is 2% of the price. The program should output the total price of all items, the shipping cost, and the total cost.
b. Task 2(4 pts): A program that prompts the user for an initial balance and a monthly interest rate and then displays each new monthly balance for a 12 month period. (Interest is compounded. Print inside the loop so you display each of the 12 balances not just the final.)
c. Task 3(3 pts): A program that collects a series of grades (ranging 0100) until the user indicates that they dont want to continue entering values useing a sentinel value. -1 is a good choice for a sentinel here.)
The program should display the average of the grades entered.
d. Task 4(5 pts): Rock Paper Scissors: The game repeats as long as the user enters Y to a prompt to continue. Get a move from player A and then from player B. Assume that the move is valid so it has to be one of the 3 choices (R P or S). Your program should compute the winner with an appropriate output string: Rock Breaks Scissors Player A wins, etc... And then prompt to play again...
Extra Credit Options:
e. Task 5(4 pts): Code a number guessing game. The user picks a number between 1 and 10 and the computer guesses the value. Each time, the player indicates if the guess is larger or smaller by entering a plus or a minus sign. If the computer guesses the value correctly then the user enters a exclamation point !. Assume in this case that the player/user it truthful.
f. Task 6(2 pts): A program that displays the 12 by 12 multiplication table. This is a bit of a challenge as it requires a nested loop so Ill grant you extra credit if you complete it!

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

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions

Question

Evaluate the importance of the employee handbook.

Answered: 1 week ago

Question

Discuss the steps in the progressive discipline approach.

Answered: 1 week ago