Write a program that converts a number entered in Roman numerals to a
positive integer. Your program should consist of a class, say, romanType.
An object of type romanType should do the following:
a. Store the number as a Roman numeral.
b. Convert and store the number as a positive integer.
c. Print the number as a Roman numeral or positive integer as requested
by the user.
The integer values of the Roman numerals are:
d. Test your program using the following Roman numerals: MCXIV,
See program here:
Problem: Write a program to help a local restaurant automate its breakfast billing system. The program should do the following:
a. Show the customer the different breakfast items offered by the restaurant
b. Allow the customer to select more than one item from the menu
c. 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):
Plain Egg $1.45
Bacon and Egg $2.45
French Toast $1.99
Fruit Basket $2.49
Use an array, menuList, of the struct menuItemType, as defined in Programming Exercise 2. Your program must contain at least the following functions:
– Function getData: This function loads the data into the array menuList.
– Function showMenu: This function show the different items offered by the restaurant and tells the user how to select the items.
– Function printCheck: This function calculates and prints the check. (Note that the billing amount should include a 5% tax.)
A sample output is:
Welcome to Johnny’s Restaurant
Bacon and Egg $2.45
Amount Due $4.14
Format your output with two decimal places. The name of each item in the output must be left justified. you may assume that the user selects only one item of a particular type.
See program below:
Can you feel the Bern!?
Problem: Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate’s name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election.
Problem: For faster sorting of letters, the United States Postal Service encourages companies that send large volumes of mail to use a bar code denoting the ZIP code. The encoding scheme for a five-digit ZIP code is show in Table 1. There are full-height frame bars on each side. The fie encoded digits are followed by a correction digit, which is coputed as follows: Add up all digits, and choose the correction digit to make the sum a multiple of 10. For example, the zip code 95014 has sum of digits 19, so the correction digit is 1 to make the sum equal to 20.
Each digit of the zip code, and the correction digit, is encoded according to Table 1, where 0 denotes a half bar and 1 a full bar. Note that they represent all combinations of two full and three half bars. The digit can be easily computed from the bar code. For example, 0110 is 0 x 7 + 1 x 4 + 1 x 2 + 0 x 1 + 0 x 0 = 6. The only exception is 0, which would yield 11 according weight formula.
Write a program that asks the user for a zip code and prints the bar cod. Use : for half bars, | for full bars. For example, 95014 becomes
Where the first and last bar represent frame bars. The general format is:
Frame-bar, digit1, digit2, digit 3, digit 4, digit 5, check-digit, Frame-bar
See program below for solution:
The following project shows how one can take data from an input text file, and display it into an output text file as a table.
Solving the quadratic equation for any real or imaginary solutions is fun. See the source code below:
Maybe you want to Pay your employees. Maybe you don’t. In the case of the former there’s a link to a quick and easy C++ paycheck calculator at the bottom of the following problem:
Write a program that calculates and prints the monthly paycheck for an employee. The net pay is calculated after taking the following deductions;
Federal Income Tax: 15%
State Tax: 3.5%
Social Security Tax: 5.75%
Medicare/Medicaid Tax: 2.75%
Health Insurance: $75.00
The program should prompt the user to input the gross amount and the employee name. The output will be stored in a file. Format your out put to have two decimal places. A sample output follows:
Gross Amount: ………..$375.00
Federal Tax: ………………$536.25
State Tax: ……………………$125.13
Social Security Tax: …..$ 205.56
Medicare/Medicaid Tax: $98.31
Pension Plan: ………………$ 178.75
Health Insurance: ……….$ $75.00
Net Pay: ………………………..$2356.00
The first column is left-justified, and the right column is right-justified
See Algorithm as comment above the Code below