While loop that allows the user to continue entering

Assignment Help C/C++ Programming
Reference no: EM13165292

This code should include a while loop that allows the user to continue entering employees as long as they want to continue:

int main()
{
Real payrate,hours, gross,again;

cout << "Enter the employees hourly pay rate. \n";
cin >> payrate;

cout<< "Enter the total hours worked by employee. \n";
cin >> hours;

while (payrate > 18.25 || payrate < 7.50)
{
    cout << "The valid value for pay rate is in the range. \n";
    cout << " of $7.50 through $ 18.25. \n";
    cout << "Enter a valid value for pay rate. \n";
    cin >> payrate;
}

while (hours > 40 || hours < 0)
{
    cout << "Please enter hours worked between 0 and 40. \n ";
    cin >> hours;
}


gross = payrate * hours;
cout << "The gross pay of the employee is $ " << gross << endl;
}

Reference no: EM13165292

Questions Cloud

Write the hexadecimal representation for -1.0 : For IEEE 754 single precision floating point, write the hexadecimal representation for -1.0
Code should include a loop that displays income : This code should include a loop that displays income generated from ticket sales for each night. Shows are performed on Thursday, Friday and Saturday nights.
Implements both the quicksort and mergesort algorithms : Write a program that correctly implements both the Quicksort and Mergesort algorithms. The program should generate an array of 500 random numbers in the 1-100 range. The program should sort the same set of numbers and keep time stamps of how long it ..
How to link different classes forms : How to link different classes forms. When a person clicks on A, B, or C the program will go to the addEmployee form or Punch In/Out form in Java.
While loop that allows the user to continue entering : This code should include a while loop that allows the user to continue entering employees as long as they want to continue:int main(){Real payrate,hours, gross,again;
E easy to process in a cobol variable-length record : Which would be easy to process in a COBOL variable-length record or fixed-length record?
Create a data structure containing a list of degree : Create a data structure containing a list of degrees available (i.e. PhD, MS, MA, BS, etc) and a price for each degree.
Solve this problem with solution :homogeneous coordinates : solve this problem with solution :homogeneous coordinates
Literature plan : You have just been hired to teach at a new preschool. You will be teaching a class of 3-5 year olds. Your task is to create a research-based “Literature Program” which will include developmentally appropriate approaches to teaching and learning. Your..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a menu driven program for an online beef

Write a menu driven program for an online beef distribution company. There are 8 different

  Develop a two dimensional interactive game

The player starts as a disk, but can "morph" (that is expand and contract) in selected directions

  Write a program that allows users to enter a dollar amount

Write a program that allows users to enter a dollar amount for their bank account balance at the beginning of the month.

  Stores a series of numbers in a binary tree.

Queue Converter, Write a program that stores a series of numbers in a binary tree. Then have the program insert the values into a queue in ascending order. Dequeue the values and display them on the screen to confirm that they were stored in the prop..

  To reverse the order of elements on a stack

Write a program in C++ to  reverse the order of elements on a stack S using two additional stacks using one additional stack

  Write a program to convert between rectangular

Write a program to convert between rectangular and cylindrical coordinates, based upon user input. For example, if the user wants to convert cylindrical to rectangular coordinates, the user would input r, ?, z values and the program would output x, y..

  Show the deatils of an emplyoee - c programming

Show the deatils of an emplyoee in a neat format.

  Write an lc-3 machine language program

Write an LC-3 machine language program starting at location x3000 which divides the number in memory location x4000 by the number in memory location x4001 and stores the quotient at x5000 and the remainder at x5001.

  Operating system and cpu scheduling

Operating System and CPU Scheduling

  This program will simulate the game of hearts

This program will simulate the game of Hearts, which is a four-player trick-taking game using any ordinary deck of playing cards. Each player is dealt thirteen cards. Whoever is dealt the Two of Clubs must lead it to the first trick. Each person p..

  Base process which communicate with child processes

Write a program which has a "base process" which communicates with child processes acting as "bombers" that it creates.

  Time conversion

Write a C++ program that takes an Eastern standard time in hours, minutes, and seconds,and prints it out in Central time, Mountain time, or Pacific time.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd