C++ Programming: Math Conversions, Reservations, and More!
IEGR 304 MiniProject #3 (Fall 2015) Date Due: December 8, 2015 (by 12:00pm)
(NOTE: No late assignments will be accepted for any reasons!)
C++ Programming: Math Conversions, Reservations, and More!
Each team (listed below) must create a C++ program which accomplishes the specified conversions or other
duties as specified below. Use all that you have learned…including lessons learned from your exciting lab
assignments, earlier mini-projects, and class lecture notes.
General Guidelines for ALL groups:
If you have not done so, each team should send an email (and Cc everyone) to the instructor identifying who the team members are and who will be the team lead…the one responsible for submitting the work
You cannot use any pre-existing code on the Internet/user-created libraries from the Internet/built-in functions, etc. to accomplish the tasks at hand (it must be originally developed by your team)
Use only the libraries discussed in our class to do this miniproject assignment
Your programs MUST only be submitted in modular form (this means functions/sub-programs and not any top-down programming). NOTE: Any top-down programming submitted as a final program will not
be graded
You may use as much repetition (for loops) and decision constructs (if…else logic) as necessary…as long as math, input, and output is not performed in the main ( ) function
You MUST use arrays to store much of the information in these miniprojects
Be sure to store many things as necessary in case you need to recall items later in the code…including the original values entered by the user
Each function declared in the code MUST include comments as normally performed (I will be specifically looking at this as well as code neatness and C++ etiquette)
Be sure to use the system “pause” and/or “cls” commands if and when necessary
Lastly, send the C++ source (.cpp) file as an attachment to the instructor before/by the due date & time via Bb only.
Only ONE person per team can serve as the team lead and be the one responsible for submitting the work via Bb…remember, just ONE team lead needs to send the file!
SUPER IMPORTANT: Be sure to use the heading comments below at the top of the miniproject and include every member on the NAMES: line
Now, the details follow on the next pages for the tasks which each group must accomplish!
Group 1, Group 3, & Group 4: Math Conversions Program
1) Your program must convert values from Decimal to Binary, Decimal to Octal, and Decimal to Hexadecimal
using the Division Method only for each. Also, offer a bonus conversion of Binary to Decimal for the users as
well.
The program you write must be able to handle all values up to 4 bytes in size (that’s 32 bits folks)
Create an opening display screen which shows the new software title, the authors who created it
Be sure to let the users know what the software will do on the next screen
The code must include a menu which would allow the user to choose the conversion they want to use or to quit the program
Once the program solves the problem and shows the result, the menu must reappear to give the same options to once more
2) The program must display the following menu (or very similar):
Welcome to the IE Decimal Conversion Program!
To choose a conversion, enter a number from the menu below
1) Decimal to Binary
2) Decimal to Octal
3) Decimal to Hexadecimal
4) Bonus: Binary to Decimal
5) Quit the program
The switch ( ) function MUST be used to handle the decision-making from the above menu
Once the program determines the conversion selected by the user, it must branch to the individual function modules to calculate the necessary math
Then, output of each solution must also be in its own function(s) as well
Lastly, the user must be given the opportunity to do another conversion (go back to the initial menu) and the program should not quit/end on its own unless the user chooses to do so (by selecting 5 in the menu).
3) Your output must show results up to 32 bits wide
Example, if I wanted to convert from the decimal value of 657066119 to binary, you output could look like this:
Your original decimal value of 657066119 is equivalent to the following binary value:
100111001010100000100010000111
Optionally…you could show the full 32 bits with leading zeros. The value would then be displayed as the
following:
00100111001010100000100010000111
Group 2, Group 7, & Group 8: Restaurant Program
Your program must determine seating reservations and food pricing in a restaurant.
The ISE Restaurant consists of five tables (i.e., it’s a new indoor restaurant – the outdoor portion is closed for
the season!) where each table can seat up to 5 for a total restaurant capacity of 25. There are several cooks and
waiters who work there daily. Your task is to write a table seating reservation program using C++ with the
following features:
1) The program must use arrays (see class notes and the topics entitled “Arrays” and “Character Sequences” at
cplusplus.com for additional help). It may be best to use both integer arrays and/or character arrays for the
following information:
Each table must use arrays to
a) hold the name of the party (i.e., just a last name such as Johnson is required) b) hold a marker that would be used for identifying whether the table is occupied or not, and c) store the quantity of people seated at the table.
2) The program must use functions/subprograms throughout. It must also display the following menu (see the
next page):
Welcome to the ISE Restaurant Seating & Billing Program!
To choose a function, enter one of the letter choices below:
a) Show the quantity of empty tables & occupied tables
b) Show the names of the parties which occupy tables (or a message if
all are available)
c) Assign a party to an available table (employee’s choice)
d) Delete a party name if reservation is cancelled or when a party is
finished
e) Calculate a bill for each table when a party is done
f) Quit the program
3) The program successfully executes the promises of its menu. Choices ‘c’ and ‘d’ will require additional
input, and each of these menu choices must allow the option for the user to abort the entry at any time.
4) Choice ‘e’ should have a sub-menu with eight items with pricing (which can be made-up by your team).
These items must include choices such as (a) a cheeseburger, (b) a hamburger (without cheese), (c) a hot-dog,
(d) chicken fingers, (e) order of French fries, (f) order of onion rings, (g) a medium soda, and (h) a medium
water (which should be free of charge). The medium size cup is all that is available, but free re-fills are
available for all drinks from each waiter – this does not need to be modeled in your program of course!
Quantities of food items, the actual item names, and pricing for each table should be printed on a clear screen
once the party has finished. Gratuity (15%) must be added automatically to the bill to tables with parties of
three or more people. A 6 % tax must also be included (after the gratuity). Make this final bill look very neat
and clean by using the <iomanip> library and along with the functions and keywords setw( ), fixed, showpoint,
setprecision( ), etc. which you have learned earlier during the semester.
5) After executing a particular function, the program shows the main menu again (i.e., you must use the
system(“cls”) statement to clear the screen before re-displaying the menu), except when choosing option ‘f’
which will quit the program. When this option ‘f’ is selected, the menu does not have to be displayed again.
Group 5 & Group 6: Theatre Tickets Program
Your program must determine ticket prices for groups which want to reserve seats at a theatre.
The ISE Theatre consists of two tiers along with orchestra seating. The two tiers are the 2 nd
Mezzanine (the
highest level) and 1 st Mezzanine (the middle level). The lower level has the Orchestra Center seats, Orchestra
Left-side seats, and the Orchestra Right-side seats. There are several ushers who work there daily to help folks
to their seats before the shows. Your task is to write a theatre seating reservation program using C++ with the
following features:
1) The program must use arrays (see class notes and the topics entitled “Arrays” and “Character Sequences” at
cplusplus.com for additional help). It may be best to use both integer arrays and/or character arrays for the
following information:
Each section must use arrays to
a) hold the name of the party (i.e., just a last name such as Jones is required) b) hold a marker that would be used for identifying whether the seats are occupied or not, and c) store the quantity of people seated in the sections of the theatre (each section has a maximum of
20 seats)
2) The program must use functions/subprograms throughout. It must also display the following menu:
Welcome to the ISE Theatre Program!
To choose a function, enter one of the numeric choices below:
1) Show number of empty & occupied seats for each section
2) Show names associated with occupied seats for each section
3) Assign a customer name to a seat or block of seats
4) Delete a seat assignment or a block seats
5) Calculate the total ticket price for each customer name
6) Quit the program
3) The program successfully executes the promises of its menu. Menu choices (3) & (4) will require additional
input if multiple blocks of seats need to be assigned to one name or deleted from one name. Each of these menu
choices must allow the option for the user to abort the entry at any time.
4) Menu choice (5) should determine the total ticket price for each last name based on quantity and seating
location within the theatre. A 6 % ticket surcharge must also be included in this total price. Make this final bill
look very neat and clean by using the <iomanip> library and along with the functions and keywords setw( ),
fixed, showpoint, setprecision( ), etc. which you have learned earlier during the semester.
5) After executing a particular function, the program shows the main menu again (i.e., you must use the
system(“cls”) statement to clear the screen before re-displaying the menu), except when choosing menu option
(6) which will quit the program. When this option (6) is selected, the menu does not have to be displayed again.
Final Programming Notes:
Test it thoroughly before submission. This means let others outside of your class try it out first before
submitting it! If they can’t use your program or have a lot of questions about how to do something, this
indicates that your program needs more work and needs to be made more user-friendly. Thus, your team should
modify the code and let the outside user(s) try again later after the modifications are made.
Your team must be sure that the code runs on Microsoft Visual Studio C++. TEST THIS if using
something else BEFORE you send it to me!!! I will not run this and grade it based on Xcode since this
was not taught in the IEGR 304 class or used in the IE/SOE labs.
When fully complete, check to make sure your program is working properly (100%) with a calculator or by
hand. If done correctly, the math results should match! Lastly, be sure to send the C++ source code (.cpp file)
on time. NO LATE MINIPROJECTS WILL BE ACCEPTED.
If you have any questions, email me or come during office hours. Good Luck!
Posted on December 4, 2015 by Dr. Richard A. Pitts, Jr.
Last updated December 4, 2015 at 8:30pm.