Question

1. Write a C++ program that will ask the user for their full name and calculate...

1. Write a C++ program that will ask the user for their full name and calculate the user's weekly salary based on their hourly wage and the number of hours they worked, assuming no overtime at this point.

Sample program run:

Please enter first name: Elmer
Please enter middle initial (Enter space if none): J
Please enter last name: Fudd
Enter hours worked: 37.5
Enter hourly rate: 10.35

Your name is: Elmer J. Fudd
Your weekly salary is: $388.12

2. Write your pseudocode/outline.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As per HomeworkLib policy solving first part, post second part as different question adding this solution....

#include<iostream>

using namespace std;

int main() {

  string fName, lName;

  char mName;

  double hours, perHourRate;

  

  cout<<"Please enter first name: ";

  cin>>fName;

  

  cout<<"Please enter middle initial (Enter space if none): ";

  cin>>mName;

  

  cout<<"Please enter last name: ";

  cin>>lName;

  

  cout<<"Enter hours worked: ";

  cin>>hours;

  

  cout<<"Enter hourly rate: ";

  cin>>perHourRate;

  

  double weeklySalary = hours* perHourRate;

  cout<<"Your name is: "<<fName<<" ";

  if(mName != ' ') {

    cout<<mName<<". ";

  }

  cout<<lName<<endl;

  

  cout<<"Your weekly salary is: $"<<weeklySalary<<endl;

}

Output

Please enter first name: Elmer
Please enter middle initial (Enter space if none): J
Please enter last name: Fudd
Enter hours worked: 37.5
Enter hourly rate: 10.35
Your name is: Elmer J. Fudd
Your weekly salary is: $388.125

Add a comment
Know the answer?
Add Answer to:
1. Write a C++ program that will ask the user for their full name and calculate...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • use at least two functions in your program. . Write a program that calculates weekly payment....

    use at least two functions in your program. . Write a program that calculates weekly payment. The program will ask the user full name, ID number (make one up), and hours worked. An hourly worker’s gross pay is basically his/her work hours that week multiplied by his/her regular hourly pay rate. However, after the first 40 work hours of the week, each additional work hour is paid at an overtime rate that is 1.5 times of the regular hourly rate....

  • Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user...

    Styles Program Description Write a C++ program that computes and displays employees' earnings. Prompt the user for type of employee (hourly ("h"or "H") or management ("'m" or "M") If the employee is management: . get the annual salary get the pay period (weekly ("w" or "W"), bi-weekly ("b" or "B") or monthly ("m" or e compute the gross salary for the pay period (Divide annual salary by 52 for weekly, 26 for bi-weekly, and 12 for monthly) deduct from gross...

  • Write a program that will compute the user annual salary. Prompt the user the enter (1)...

    Write a program that will compute the user annual salary. Prompt the user the enter (1) the weekly salary. Store the information in a double variable. Prompt the user to enter the number of weeks worked in a year. Use an int variable for that. Write code that will compute the user's Annual salary. Gross salary is salary before any deductions are taken. Update the code and prompt the user to enter the federal tax rate and the state's tax...

  • Write a C++ console application that uses functions to calculate an employee’s salary.

    Write a C++ console application that uses functions to calculate an employee’s salary.PART 1: Create a void function to print a menu asking the user to choose from the following options:1 - Annual salary2 - Monthly salary3 - Daily rate of pay4 – ExitThe void function only prints the menu. Format your cout statement to include the menu as displayed above.If the chosen option is 1- Annual Salary, ask the user for the number of hours they work perweek and...

  • Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a...

    Program 3. Decisions Due: Friday, February 7 by 11:59 PM Overview For this program, design a wage calculator for a single user. The program will use the user's number of hours worked and their hourly wage to calculate: Gross Pay Deduction Net Pay The Gross Pay is the amount that the user is paid before any deduction is applied. The pay amount is based upon the number of hours worked. If 40 hours or less were worked, the gross pay...

  • Program Description: Write the pseudocode for a program that will calculate and display an employee’s gross...

    Program Description: Write the pseudocode for a program that will calculate and display an employee’s gross pay. Input the number of hours an employee worked for each of the 5 days of the week. Add them all up to get his hours worked for the week. Weekly Pay is calculated by adding an employee’s normal pay plus any overtime pay. Normal hours are paid at $10/hr. Any over time is paid at $15/hr. Any hours over 40 are considered overtime....

  • C coding language is used. Write a program that declare parallel arrays for storing information about...

    C coding language is used. Write a program that declare parallel arrays for storing information about 10 employees. One array will store the hours each person worked for a week and a second array will store each person's weekly pay. Your program should ask the user for the number of hours each of the 10 employees worked. The pay should calculate both regular and overtime pay. Assume that all 10 employees earn $15.25 per hour. Your program should allow the...

  • I NEED ALL QUESTIONS OR ELSE THUMBS DOWN! C++ Implement a structure Employee. An employee has...

    I NEED ALL QUESTIONS OR ELSE THUMBS DOWN! C++ Implement a structure Employee. An employee has a name (a char *) and a salary (a double). Write a default constructor, a constructor with two parameters (name and salary), and methods char* getName() double getSalary() to return the name and salary. Write a small global function TestEmployee() to test your structure. Creating a new employee. Please type the name: Larry Bird Please specify the salary: 200000 New employee has been created....

  • in c++ A: Write a program which ask user to enter 10 student's name and their...

    in c++ A: Write a program which ask user to enter 10 student's name and their grades. Then find the average of all the grades. Output all the grades with student name of whom got the grade over the average.

  • write in python idle Write full program that asks the user to enter his/her name then...

    write in python idle Write full program that asks the user to enter his/her name then repeatedly ask to enter the temperature in Fahrenheit and convert it to Celsius, the program should then prompt the user if he/she wants to continue or exit the program. The formula for conversion is: °C = (°F - 32) x 5/9 The program should use a function for the conversion. An Example of a sample run should appear on the screen like the text...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT