Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ICE6_2: [First develop your pseudocode or flowchart] - Exer-1: Write a program that asks the user to enter the number of hours they worked in

image text in transcribedimage text in transcribedimage text in transcribed

ICE6_2: [First develop your pseudocode or flowchart] - Exer-1: Write a program that asks the user to enter the number of hours they worked in a given week. The number of hours entered is in the range of 0 to 60. Also ask the user to enter their pay rate. The rate is a positive value above minimum wage (assume minimum wage of $15 ). - Your program should ask the user to re-enter the values for hours and wages until valid inputs are given. - Based on the hours entered, calculate their wages as follows: - 40 hours or less: regular pay - over 40 hours and up to 50 : regular pay for first 40+1.5 regular pay for extra hours above 40 - over 50 hours and up to 60 : regular pay for first 40+1.5 regular pay for next 10 hours +2 regular pay for extra hours above 50 - Exer-3: Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompt the user to enter each of his or her expenses for the month and keep a running total. When the loop finishes, the program should display the amount that the user is over or under budget. Use a WHILE loop with a sentinel of 0 to end the expenses loop and use an augmented assignment operator to maintain the running total of expenses. HICE6_2 Exer-3 - Exer-4: The "Prime or Not?" pseudocode (see Flowcharts PowerPoint slide \#4), prints "Not prime" if a number is not prime, but does not print a message if the number is prime. As recently mentioned in class, that is because we did not want to introduce flags at the (early) point in the course when we covered pseudocode and flowcharts. We pointed out that not printing a message when the number is prime is not good practice. We can address this now, because we understand how flags are used. We also understand how to check whether a number entered by the user is appropriate. Write a program that implements the algorithm of Flowcharts slide \#4 (the "Prime or Not?" problem (do not use a different algorithm); using a while loop (as in the pseudocode), a flag (to indicate whether the number is prime) and the augmented assignment operator. The program prints a message indicating whether the number is prime or not. In addition, your code should ensure that the number the user enters is a positive whole number greater than 1 ; have the user re-enter the number if it is not greater than one. Sample output follows: Enter a positive whole number: -2 Enter a positive whole number: Enter a positive whole number: 1 Enter a positive whole number: 8 8 is a NOT a prime number! Enter a positive whole number: 7 7 is a prime number! ;.M HICE6_2 Exer-4

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

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

Know the ethical issues and consequences of downsizing.

Answered: 1 week ago

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago