Question

Please write in C++ MEMO To: The Programming Staff From The Boss I need a program that will help me figure out who gets...

Please write in C++

MEMO To: The Programming Staff From The Boss I need a program that will help me figure out who gets what for this year’s annual bonuses. Here are the conditions: Every employee gets a basic bonus of $1000. All the employees in department 2 get an additional $1000 bonus (above the basic bonus) unless they have more than five dependents. Any employee with more than five dependents gets a $5000 bonus. And no – you can’t put in a special bonus for the programming department. Your program will permit me to enter an employee’s first and last names, the number of the department he or she works in, and their number of dependents. The program will then respond with the name of the employee and the amount of that employee’s annual bonus.

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

Program

#include <iostream>

using namespace std;
int main()
{
    string fname,lname;
    int nod,dept_no,bonus=1000;
    cout<<"Enter employee first name: ";
    cin>>fname;
    cout<<"Enter employee last name: ";
    cin>>lname;
    cout<<"Enter the number of the department he or she works in: ";
    cin>>dept_no;
    cout<<"Enter number of dependents: ";
    cin>>nod;
    if(dept_no==2)
    {
        if(nod<5)
            bonus+=1000;
        else
            bonus+=5000;
    }
    cout<<"Annual bonus for "<<fname<<" "<<lname<<" is $"<<bonus;
    return 0;
}


Output

Enter employee first name: tim
Enter employee last name: cook
Enter the number of the department he or she works in: 2
Enter number of dependents: 3
Annual bonus for tim cook is $2000

Add a comment
Know the answer?
Add Answer to:
Please write in C++ MEMO To: The Programming Staff From The Boss I need a program that will help me figure out who gets...
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
  • Please write the following program in Java That last idea at PicoSoft didn't work out too...

    Please write the following program in Java That last idea at PicoSoft didn't work out too well … management has a massive public relations disaster on their hands, and thus they decide to revise the bonus structure, as well as give eveyone some additional vacation time. Write a program that reads in (from the keyboard) the following information about an employee: Last name First name Years worked (a whole number) Annual salary An employee's vacation time is based upon the...

  • I really need help with this, please. This is a java programming assignment. Project 1 The first programming project inv...

    I really need help with this, please. This is a java programming assignment. Project 1 The first programming project involves writing a program that computes the salaries for a collection of employees of different types. This program consists of four classes. 1. The first class is the Employee class, which contains the employee's name and monthly salary, which is specified in whole dollars. It should have three methods: a. A constructor that allows the name and monthly salary to be...

  • Please help me write in C++ language for Xcode. Thank you. In this lab you are...

    Please help me write in C++ language for Xcode. Thank you. In this lab you are going to write a time card processor program. Your program will read in a file called salary.txt. This file will include a department name at the top and then a list of names (string) with a set of hours following them. The file I test with could have a different number of employees and a different number of hours. There can be more than...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

  • programming language c++ its a project if anyone can help me it's will be appreciated thnk...

    programming language c++ its a project if anyone can help me it's will be appreciated thnk u. u have to create a code based on the information im giving u you can do it in 1 or 2 day i can wait 1:26 #WW 2.53% Example: A user starts with 1000 points. Game #1 - user chooses to risk 200 points. User wins game (beats the dealer). User now has 1200 points. Game #2 - user chooses to risk 500...

  • I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I...

    I NEED HELP WITH DEBUGGING A C PROGRAM! PLEASE HEAR ME OUT AND READ THIS. I just have to explain a lot so you understand how the program should work. In C programming, write a simple program to take a text file as input and encrypt/decrypt it by reading the text bit by bit, and swap the bits if it is specified by the first line of the text file to do so (will explain below, and please let me...

  • I need help with this assignment in C++, please! *** The instructions and programming style detai...

    I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...

  • Need C programming help. I've started to work on the program, however I struggle when using...

    Need C programming help. I've started to work on the program, however I struggle when using files and pointers. Any help is appreciated as I am having a hard time comleting this code. #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_LINE 100 #define MAX_NAME 30 int countLinesInFile(FILE* fPtr); int findPlayerByName(char** names, char* target, int size); int findMVP(int* goals, int* assists, int size); void printPlayers(int* goals, int* assists, char** names, int size); void allocateMemory(int** goals, int** assists, char*** names, int size);...

  • Using C programming REQUIREMENTS: This program is a letter guessing game where a simple Al opponent...

    Using C programming REQUIREMENTS: This program is a letter guessing game where a simple Al opponent generates a secret letter for the user to guess. The user must be able to take turns guessing the secret letter, with the Al responding to the user's guesses. After successfully guessing, the user must be allowed to play again. The Al must count how many turns the user has taken. Here is an example of a game in progress where the human user...

  • I need help with this code, I'm stuck on it, please remember step 4, I'm very...

    I need help with this code, I'm stuck on it, please remember step 4, I'm very much stuck on that part. It says something about putting how many times it appears Assignment #1: Sorting with Binary Search Tree Through this programming assignment, the students will learn to do the following: Know how to process command line arguments. 1 Perform basic file I/O. 2. Use structs, pointers, and strings. Use dynamic memory. 3. 4. This assignment asks you to sort the...

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