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

  Variables should be private and the class functions public

All the class variables should be private and the class functions public. The class functions should be implemented in a file Inventory.cpp which should be linked with the inventory.hpp file.

  rewrite that statement in a more readable style.

Give an example statement in C, C++, or Java that is particularly unreadable. Rewrite that statement in a more readable style.

  Asks the user for the name of an input file and translates

Write a C++ program that asks the user for the name of an input file and translates the contents of that input file using ROT13. Your  main  function should be responsible for reading the input file and coordinating calls to a value-returning functio..

  Change this code to read in strings from a text file

code takes in a string from a user, checks if the paranthesis are ballanced (as defined by my class) and also returns the variable from my line (also from my class). All like to change this code to read in strings from a text file (each line is a str..

  Prepare a businesspartner

Prepare a BusinessPartner class that contains a company name, first name and a telephone number.

  Difference between a constant pointer

Explain the difference between a constant pointer to non-constant data and a non-constant pointer to constant data. Show the syntax to declare them.

  Brownian motion is a physical phenomenon

Brownian motion is a physical phenomenon which can be observed, for instance, when a small particle is immersed in a liquid.

  Write a program that inputs a dollar amount to be printed

Write a program that inputs a dollar amount to be printed on a check and then prints the amount in check-protected format with leading asterisks if necessary

  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.

  Write a full program that implements the aggregation concept

Write a full program that implements the aggregation concept for the Mail Message, Header , Body and Attachment classes.

  C++ class that has a dynamic array of a string

show  an example of a C++ Class that has a dynamic array of a string that takes in names by user input??

  Program to store lists of names and ages in parallel arrays

Write a C++ program that stores lists of names (the last name first) and ages in parallel arrays and sorts the names into alphabetical order keeping the ages with the correct names.

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