Question

In: Computer Science

Chapter 2, Problem 4E in An Introduction to Programming with C++ All of the employees at...

Chapter 2, Problem 4E in An Introduction to Programming with C++

All of the employees at Merks Sales are paid based on an annual salary rather than an hourly wage. However, some employees are paid weekly while others are paid every other week (biweekly). Weekly employees receive 52 paychecks; biweekly employees receive 26 paychecks. The payroll manager wants a program that displays two amounts: an employee’s weekly gross pay and his or her biweekly gross pay. Complete an IPO chart for this problem. Desk-check the algorithm using $56,700 as the salary. Then desk-check it using $32,660.

I am requesting help on creating the algorithm and desk checking it.

Solutions

Expert Solution

Program

#include<iostream>

//Use std namespace

using namespace std;

//Define a main method

int main()

{

//Declare variable

int n;

//Declare variable

float sal, wgp, bwgp, wp, bwp;

//Loop infinite

while(1)

{

//Display message

cout<<"Enter salary";

//Store value

cin>>sal;

//Compute weekly pay

wgp = sal/52;

//Compute bi weekly pay

bwgp = sal/26;

//Display message

cout<<"\n Salary = "<<sal<<"\n";

//Display message

cout<<"Weekly Gross Pay = "<<wgp<<"\n";

//Display message

cout<<"Biweekly Gross Pay ="<<bwgp<<"\n";

//Display message

cout<<"Enter 0 to terminate or any int value to continue";

//Store value

cin>>n;

//If value is 0

if(n==0)

//Break

break;

}

//Display new line

cout<<"\n";

//Pause console window

system("pause");

//Return 0

return 0;

}


Related Solutions

Explanation of the problem chapter 3.12 problem 49 of the book introduction to the mathematical programming...
Explanation of the problem chapter 3.12 problem 49 of the book introduction to the mathematical programming 4th edition Solution: Step # 1 Let Xij be the amount of money invested at the beginning of month i, for a period of j month. Objective function: Step # 2 The objective is to maximize the available cash at the beginning of month 5. X14 = collect the money invested at the beginning of month 1 of 4 months. X23 = collect the...
Case Problem 2 Chapter 7 Introduction to Linear Programming Production Strategy Production Strategy Better Fitness, Inc....
Case Problem 2 Chapter 7 Introduction to Linear Programming Production Strategy Production Strategy Better Fitness, Inc. (BFI) manufactures exercise equipment at its plant in Freeport, Long Island. It recently designed two universal weight machines for the home exercise market. Both machines use BFI-patented technology that provides the user with an extremely wide range of motion capability for each type of exercise performed. Until now, such capabilities have been available only on expensive weight machines used primarily by physical therapists. At...
C++ Programming: Programming Design and Data Structures Chapter 13 Ex 2 Redo Programming Exercise 1 by...
C++ Programming: Programming Design and Data Structures Chapter 13 Ex 2 Redo Programming Exercise 1 by overloading the operators as nonmembers of the class rectangleType. The header and implementation file from Exercise 1 have been provided. Write a test program that tests various operations on the class rectangleType. I need a main.cpp file Given: **************rectangleType.cpp******************** #include <iostream> #include <cassert> #include "rectangleType.h" using namespace std; void rectangleType::setDimension(double l, double w) { if (l >= 0) length = l; else length =...
Introduction Introduction to Data Structures programming assignments can be completed either in C++ (preferred) or in...
Introduction Introduction to Data Structures programming assignments can be completed either in C++ (preferred) or in Java. In both cases you cannot use libraries or packages that contain pre-built data structures, other than built-in support for objects, arrays, references, and pointers. Classes in C++ and Java can represent anything in the real world. This assignment is to write a compiler for Z++ programming language. The Z++ Programming Language Your program will test if an expression entered by the application user...
C++ Programming level 1 using step number 2 is a must Guess the Number Introduction In...
C++ Programming level 1 using step number 2 is a must Guess the Number Introduction In this assignment you will create a program that will simulate a number guessing game. Skills: random, while-loop, Boolean flags Algorithm to win The guess the number game has an algorithm to lead to the winning value. The way it works is say you have the set of numbers 1 to 100. You always begin by choosing the half-way point, then a hint will be...
This is C# programming. In Chapter 2, you created an interactive application named GreenvilleRevenue. The program...
This is C# programming. In Chapter 2, you created an interactive application named GreenvilleRevenue. The program prompts a user for the number of contestants entered in this year’s and last year’s Greenville Idol competition, and then it displays the revenue expected for this year’s competition if each contestant pays a $25 entrance fee. The programs also display a statement that compares the number of contestants each year. Now, replace that statement with one of the following messages: If the competition...
C Programming Language (Code With C Programming Language) Problem Title : Which Pawn? Jojo is playing...
C Programming Language (Code With C Programming Language) Problem Title : Which Pawn? Jojo is playing chess himself to practice his abilities. The chess that Jojo played was N × N. When Jojo was practicing, Jojo suddenly saw a position on his chessboard that was so interesting that Jojo tried to put the pieces of Rook, Bishop and Knight in that position. Every time he put a piece, Jojo counts how many other pieces on the chessboard can be captured...
This problem will give you hands-on practice with the following programming concepts: • All programming structures...
This problem will give you hands-on practice with the following programming concepts: • All programming structures (Sequential, Decision, and Repetition) • Methods • Random Number Generation (RNG) Create a Java program that teaches people how to multiply single-digit numbers. Your program will generate two random single-digit numbers and wrap them into a multiplication question. The program will provide random feedback messages. The random questions keep generated until the user exits the program by typing (-1). For this problem, multiple methods...
The purpose of this C++ programming assignment is to practice using an array. This problem is...
The purpose of this C++ programming assignment is to practice using an array. This problem is selected from the online contest problem archive, which is used mostly by college students worldwide to challenge their programming ability and to prepare themselves for attending programming contests such as the prestige ACM International Collegiate Programming Contest. For your convenience, I copied the description of the problem below with my note on the I/O and a sample executable. Background The world-known gangster Vito Deadstone...
. (This is a version of Programming Project 2.1 from Chapter 2.) The Babylonian algorithm to...
. (This is a version of Programming Project 2.1 from Chapter 2.) The Babylonian algorithm to compute the square root of a positive number n is as follows: 1. Make a guess at the answer (you can pick n/2 as your initial guess). 2. Compute r = n / guess. 3. Set guess = (guess +r) / 2. 4. Go back to step 2 until the last two guess values are within 1% of each other. Write a JAVA program...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT