Question: CS 1 1 6 - Programming Fundamentals for Computer Science Lab # 6 B C + + Programming Objectives To learn to code, compile and
CS Programming Fundamentals for Computer Science Lab #B
CProgramming
Objectives
To learn to code, compile and run a program containing two or more functions.
Assignment
Plan and code a program utilizing one file for input and one file for output to solve the following problem: Write a complete program to calculate painting costs for customers of Top Quality Home Painting Service.
Function : Input
Input data from a file. One record of data contains the following sequence of data:
ABC
customer initials, customer account number digit integer the number of interior square feet to be painted, the cost per square foot for interior painting, the number of exterior square feet to be painted, the cost per square foot for exterior painting. Validate that no input is negative. If any data record contains an error, output the data to an error file with a message indicating what caused the error and do not produce a bill.
Function : Calculate. Determine the cost for interior painting, the cost for exterior painting, and the cost for the entire paint job. Any painting estimate greater than $ receives a discount.
Function : Output all data customer initials, customer account number, interior square feet, cost per interior square feet, exterior square feet, cost per exterior square feet, total interior cost, total exterior cost, any discount and total cost to an output file..
Create the data file below using your text editor or Notepad.
Data File
ABC
DEF
GHI
JKL
MNO
PQR
STU
VWX
XYZ
Output
Output and label all input and calculated data three initials,customer account number, interior square feet, cost per interior square feet, exterior square feet,cost per exterior square feet, total interior cost, total exterior cost, any discunt, and total cost to an output file. Output valid data to one file and errors to an error file.
Mske it top to down design
Main
GetData
Copy: None
Ref: IDUnits, Points, UnitError, PointError
CacGPA
Copy: Unit, Points
Ref: Total, Count, GPA
SendData
Copy: ID Unit, Points, GPA
Ref: None
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
