(This if for mindtap on cengage, if not possible, use devc++ 5.11 but mindtap is more accurate)   Instructions Consider the definition of the function main in the provided file main.cpp: The variables x, y, z, rate, and hours referred to in the bullets below are the variables of the function main. Each of the functions described must have the appropriate parameters to access these variables. Write the following definitions: Write the definition of the function initialize that initializes x and y to 0 and z to the blank character. Write the definition of the function getHoursRate that prompts the user to input the hours worked and rate per hour to initialize the variables hours and rate of the function main. Write the definition of the value-returning function paycheck that calculates and returns the amount to be paid to an employee based on the hours worked and rate per hour. The hours worked and rate per hour are stored in the variables hours and rate, respectively, of the function main. The formula for calculating the amount to be paid is as follows: For the first 40 hours, the rate is the given rate; for hours over 40, the rate is 1.5 times the given rate. Write the definition of the function printCheck that prints the hours worked, rate per hour, and the salary. Write the definition of the function funcOne that sets the value of x and y to 35 and 20 respectively. Then prompt the user to input a number. The function then changes the value of x by assigning the value of the expression two times the (old) value of x plus the value of y minus the value entered by the user. Write the definition of the function nextChar that sets the value of z to the next character stored in z. An example of the program is shown in picture file!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question

(This if for mindtap on cengage, if not possible, use devc++ 5.11 but mindtap is more accurate)

 

Instructions

Consider the definition of the function main in the provided file main.cpp:

The variables x, y, z, rate, and hours referred to in the bullets below are the variables of the function main. Each of the functions described must have the appropriate parameters to access these variables. Write the following definitions:

  • Write the definition of the function initialize that initializes x and y to 0 and z to the blank character.
  • Write the definition of the function getHoursRate that prompts the user to input the hours worked and rate per hour to initialize the variables hours and rate of the function main.
  • Write the definition of the value-returning function paycheck that calculates and returns the amount to be paid to an employee based on the hours worked and rate per hour. The hours worked and rate per hour are stored in the variables hours and rate, respectively, of the function main.

    The formula for calculating the amount to be paid is as follows:

    For the first 40 hours, the rate is the given rate; for hours over 40, the rate is 1.5 times the given rate.

  • Write the definition of the function printCheck that prints the hours worked, rate per hour, and the salary.
  • Write the definition of the function funcOne that sets the value of x and y to 35 and 20 respectively. Then prompt the user to input a number. The function then changes the value of x by assigning the value of the expression two times the (old) value of x plus the value of y minus the value entered by the user.
  • Write the definition of the function nextChar that sets the value of z to the next character stored in z.

An example of the program is shown in picture file!

After initialization: x = 0, y = 0, z =
%3D
Enter hours worked: 60
Enter pay rate: 20
Hours worked:
60
Pay Rate:
$20
This week's salary: $1400
Before calling funcone: x =
35, y = 20
Enter an integer:
After funcone: x = 88
z = B
After nextChar: z =
= C
Transcribed Image Text:After initialization: x = 0, y = 0, z = %3D Enter hours worked: 60 Enter pay rate: 20 Hours worked: 60 Pay Rate: $20 This week's salary: $1400 Before calling funcone: x = 35, y = 20 Enter an integer: After funcone: x = 88 z = B After nextChar: z = = C
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education