Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Summary
In this lab, you complete a prewritten C++
Instructions
- Variables have been declared for you, and the input statements and output statements have been written. Read them over carefully before you proceed to the next step.
- Design the logic, and write the rest of the program using a switch statement.
- Execute the program by clicking the Run button at the bottom of the screen entering the following as input:Employee’s name: Jeanne Hanson Employee’s salary: 70000.00 Employee’s performance rating: 2
- Confirm that your output matches the following: Employee Name: Jeanne Hanson Employee Salary: $70000 Employee Rating: 2 Employee Bonus: $10500
// EmployeeBonus2.cpp - This program calculates an employee's yearly bonus.
#include <iostream>
#include <string>
using namespace std;
int main()
{
// Declare and initialize variables.
string employeeFirstName;
string employeeLastName;
double employeeSalary;
int employeeRating;
double employeeBonus;
const double BONUS_1 = .25;
const double BONUS_2 = .15;
const double BONUS_3 = .10;
const double NO_BONUS = 0.00;
const int RATING_1 = 1;
const int RATING_2 = 2;
const int RATING_3 = 3;
// This is the work done in the housekeeping() function
// Get user input
cout << "Enter employee's first name: ";
cin >> employeeFirstName;
cout << "Enter employee's last name: ";
cin >> employeeLastName;
cout << "Enter employee's yearly salary: ";
cin >> employeeSalary;
cout << "Enter employee's performance rating: ";
cin >> employeeRating;
// This is the work done in the detailLoop() function
// Use switch statement to calculate bonus based on rating
// This is the work done in the endOfJob() function
// Output
cout << "Employee Name: " << employeeFirstName << " " << employeeLastName << endl;
cout << "Employee Salary: $" << employeeSalary << endl;
cout << "Employee Rating: " << employeeRating << endl;
cout << "Employee Bonus: $" << employeeBonus << endl;
return 0;
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Program Unit Score Calculator Console App Write a Python Console Application program that allows the user to enter the marks for different assessments in a unit, and computes the total mark and grade for the unit. Here is the program logic specification: There are six assessment activities Quiz1, Quiz2, Quiz3, Quiz4, Lab Journal, Major Assignment and Final Exam. The four quizzes are worth 5 marks each, the Lab Journal is worth 10 marks, the Major Assignment is worth 30 marks and the Final Exam is worth 40 marks. The algorithm for computing the total mark for the unit is: Total Mark = Quiz1+Quiz2+Quiz3+Quiz4+Major Assignment+ Lab Journal + Final Exam The following screenshot shows a successful test run:arrow_forwardInstructions Flowchart, implement in C++ & test the problem outlined in the problem statement. Submit the solution into Canvas. This program obtains a series of letter grades as input from a user. The program should calculate and output the total grade points and the grade point average (note: you may have to track the total number of inputs and the grade points to calculate the grade point average). The algorithm should execute 3 times for testing purposes. Use the appropriate loop for the main structure of the program that will stop accepting letter grades when the user inputs X. Also, choose the appropriate selection statement to convert the letter grade to the correct grade points.arrow_forwardQuestion 3arrow_forward
- Make C++ program.Your travel agency offers trips to Asian and African countries. This month, you are specifically doing trips to the Philippines (in Asia) and Tunisia (in Africa) and created a program for users to get prices and a boarding ticket. For all Asian countries, you store the name and population information in your program. With African countries, in addition to the name and population, you are also interested in location (North, South, East, West). Create an abstract Country class that holds the country name and population (given by the constructor). There should be two functions: int get_ticket_price and void_print_boarding_pass (which will output a boarding pass as a file-see below) Using the Country class, create two classes called African_country and Asian_country. The Asian_country class should use the same constructor that the Country class uses and the African_country class constructor should allow for the user to enter the location (see sample run).…arrow_forwardroblem: A small business has purchased a computer for its new payroll system. Theprogram will determine the gross wages of each employee type, salaried andhourly, and output the total gross wages to be paid for each employee type. You have been asked to complete the program, using C++, according to thefollowingspecifications:1. Prompt the user to enter the number of employee wages to be calculated. Theprogram will end when the data for all the employees has been entered. 2. For each employee, indicate if the employee is salaried or paid hourly. 3. Define and implement functions for the following:a. If the employee is salaried, enter the annual salary. The gross for that employeewill be determined by dividing the annual salary by 24. Add the result tothetotalsalaried wage. b. If the employee is paid hourly, enter hours worked (40 ≥ hours ≥ 0) and rate perhour. The gross for that employee is determined by multiplying hours workedbyrate per hour. Add the result to the total hourly wages.…arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education