Introduction to C - Programming Assignment #5
Due date: Please consult WebCourses for your section
1. Learn how to design a program using functions.
2. Review of if statements and loops.
Note: In this assignment, you are required to write one program.
Problem: Universally Comical Funland Unified (ucf.c)
Your internship with UCF has gone quite well so far. You’ve helped design software for many different areas of the park ranging from the roller coasters to the custom t-shirts and even the ever-popular UCF Idol attraction.
At some point however, your boss would like you to unify much of your work into a single large program so that the park can run more cohesively. Instead of adding any new functionality into your program, you’ll be using your recently learned skill of writing functions to make this large program more manageable.
In particular, you will write a menu-driven program that provides the user with the following options:
1) Gift Shop Shipping
2) Calorie Counter Application
3) Roller Coaster Design
4) Printing Heart T-Shirts
5) UCF Idol
Each of these options will mimic Program 2A, Program 2B, Program 2C, Program 3B, and Program 4, respectively. Thus, please consult these descriptions with respect to the functionality of your program. All input specifications and output specifications will remain the exact same as in the previous write-ups of these problems.
The main program will read the input and will invoke different functions to carry out the above subtasks (note that the main program will pass the proper values to each function). You will have to write several functions in your program and these functions must adhere to the function prototypes, pre-conditions and post-conditions specified below.
Prints the menu.
price, weight: a positive real numbers less than 100.
quantity: a positive integer less than 100.
tax: 0(if not taxed), 1(if taxed)
Given the four pieces of information as specified in
Program 2A, this function returns the total cost of
the corresponding order with shipping included.
double itemShipping(double price, double weight,
int quantity, int tax);
All four parameters are non-negative integers less
Returns the weight change (in pounds) of the person
who walked, stood, drank and ate for the number of
minutes designated, using the calculation from
double weightChange(int minWalk, int minStand,
int minDrink, int minEat);
trackLength is positive and less than 10000.
maxTrainLength is in between 10 and 100, inclusive.
pMaxPeople points to a variable that will store the
maximum number of people for this train design.
pNumCars points to a variable that will store the
number of cars per train in the ideal design as
specified in Program 2C.
The variables pointed to by pMaxPeople and pNumCars
will store the maximum number of people and the number of cars per train for this design, respectively.
void rollerCoaster(int trackLength, int maxTrainLength,
int* pMaxPeople, int* pNumCars);
size is in between 3 and 10 inclusive.
A heart with the given size will be printed, as
defined in Program 3B with the character ch.
void printHeartDesign(int size, int ch);
ifp points to the beginning of a file that stores data about UCF Idol shows, as specified in Program 4.
The results of all the shows in the file will be
printed to the screen and FILE...
Please join StudyMode to read the full document