CSIT 575 – Programming Fundamentals for Computer
Science Lab #2C
Objectives
To learn to code, compile and run a sequential
program
To learn how to obtain a program listing and output
printout
Assignment
Plan and code a program to do the following: Calculate the
total cost of an automobile repair. Use the following
rates:
Labor charges
$35 per hour
Tax on parts and supplies
9%
Input
Your program should prompt the user to enter the customer’s name,
the number of hours of labor and the cost of parts and
supplies.
Output
Output the entered values and the calculated amounts. A
sample follows. Format your output to have 2 decimal places with
all numbers aligned to the right side of the column. Sample
output:
Customer name
Jones
Hours of labor 4.50
Cost for labor 157.50
Parts and Supplies 97.00
Tax
8.73
Total Amount
Due
263.23
Constant
Use a constant definition for the tax rate and the labor charge per
hour.
Output the Customer name, hours of labor, cost for labor, cost of
parts and supplies, tax and total. Note that the left column
is left justified, and the right column is right justified with the
decimal point in the monetary amounts aligned.
Turn in
Program listing and program output. Label all output clearly.
Be sure your output file contains user prompts and what was entered
by the user .in addition to the results of your program processing.
Run with above listed data. The instructor will give you additional
data to test.
Program documentation and the first line of your output file should
include:
Code
#include <stdio.h>
// constants
const int labor_charges = 35;
const float tax_rate = 0.09;
int main()
{
float cost_parts,hours;
float total,total_tax,cost_of_labour;
char name[30];
//Input from user
printf("Enter customer's name: ");
scanf("%s",&name);
printf("Enter Hours of labor: ");
scanf("%f",&hours);
printf("Enter cost of parts and supplies: ");
scanf("%f",&cost_parts);
//Caluculation
//labour hours * hourly charge
cost_of_labour = hours*labor_charges;
//9% tax for Parts and Supplies
total_tax = cost_parts * tax_rate;
//Total cost
total = cost_of_labour + cost_parts + total_tax;
//Print outout
printf("Customer name %s",name);
printf("\nHours of labor %f",hours);
printf("\nCost for labor %f",cost_of_labour);
printf("\nParts and Supplies %f",cost_parts);
printf("\nTax %f",total_tax);
printf("\nTotal Amount Due %f",total);
return 0;
}
Source code

Output

CSIT 575 – Programming Fundamentals for Computer Science Lab #2C Objectives To learn to code, compile...
11.9 LAB*: Program: Data visualization(1) Prompt the user for a title for data. Output the title. (1 pt)Ex:Enter a title for the data: Number of Novels Authored You entered: Number of Novels Authored(2) Prompt the user for the headers of two columns of a table. Output the column headers. (1 pt)Ex:Enter the column 1 header: Author name You entered: Author name Enter the column 2 header: Number of novels You entered: Number of novels(3) Prompt the user for data points. Data points must be in this format: string, int. Store the information before the comma into a string variable and the information after the comma into an integer. The user will enter -1 when they...
An Introduction to Programming Using Visual Basic Tenth
Edition
Chapter 3 Programming Project 2
What is the solution to this project?
one of the numbers in an input text box is change the type of Auto Repair Calculator X Customer: John Doe Hours of labor: 3.5 Cost of parts and supplies 84.55 Display Bill + First number 21 Second number 77 х Customer Labor cost Parts cost Total cost John Doe $122.50 $88.78 $211.28 21 x 77 = 1617 FIGURE...
C programming. please include comments
In this lab, you will learn to read data from and write data to a file - another use for pointers. SAMPLE PROGRAM There are two sample programs this week - WriteFile.c and ReadFile.c. The first, WriteFile.c, allows the user to enter customer names (first, middle, and last), and writes each name to an output text file, customerNames.txt. formatted as: firstName middlelnitial lastName" After you've run it once, what happens to the names you added...
NOTE: LANGUAGE IS PYTHON CS160 Computer Science Lab 17 Objectives Work with dictionaries Work with functions Work with files Overview This lab will have you store the birthdays for a group of people. This program will store the information with the focus on the date of the month and not on the individual. The point of this program is to be able to see who has a birthday on a given day or to create a table of birthdays, in...
NOTE: LANGUAGE IS PYTHON CS160 Computer Science Lab 17 Objectives Work with dictionaries Work with functions Work with files Overview This lab will have you store the birthdays for a group of people. This program will store the information with the focus on the date of the month and not on the individual. The point of this program is to be able to see who has a birthday on a given day or to create a table of birthdays, in...
This is in c programming using functions in visual studios
Carpet Jolb A carpeting company wants to estimate what it will cost a customer to have a room carpeted. They can carpet 65 sq. ft. of room space in 4 hours, and they charge $25.00 per hour as their labor rate Write a program to ask the user for the length of the room (in inches) to be carpeted, the width of the room (in inches) to be carpeted, and...
CSE 002: Fundamentals of Programming Spring 2020 Homework Assignment 6: Objectives. The objective of this homework is to give you practice with writing while, for, and do-while loops. You may find it helpful to work through the check point questions embedded in the chapter, and to practice on homework problems from the text that we have not assigned. Note that solutions to the even-numbered problems are available on the book’s student resource website as described on page xii. All homework...
In C++ Programming Write a program in Restaurant.cpp to help a local restaurant automate its breakfast billing system. The program should do the following: Show the customer the different breakfast items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and print the bill. Assume that the restaurant offers the following breakfast items (the price of each item is shown to the right of the item): Name Price Egg (cooked to order)...
I need help in C++ . Project 3 – Parking Deck Ticketing System Objectives: Use if, switch, and loop statements to solve a problem. Use input and output statements to model a real world application Incorporate functions to divide the program into smaller segments Instructions: Your task is to write a program that simulates a parking meter within the parking deck. The program will start by reading in the time a car arrives in the parking deck. It will then...
Lab Objectives Be able to write methods Be able to call methods Be able to declare arrays Be able to fill an array using a loop Be able to access and process data in an array Introduction Methods are commonly used to break a problem down into small manageable pieces. A large task can be broken down into smaller tasks (methods) that contain the details of how to complete that small task. The larger problem is then solved by implementing...