Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must contain three exception classes: invalidHr, invalidMin, and invalidSec. If the user enters an invalid value for hours, then the program should throw and catch an invalidHr object. Follow similar conventions for the invalid values of minutes and seconds.
Write a program that prompts the user to enter a length in feet and then enter a length in inches and outputs the equivalent length in centimeters. If the user enters a negative number or a non-digit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers.
Your error message should read A non positive number is entered and allow the user to try again.
Format your output with setprecision(2) to ensure the proper number of decimals for testing!
You are assisting a Coffee Shop create a program to run at their kiosk for customers to purchase their items. You will create a program to create a dictionary of their current coffee products and prices:
Coffee item Price
Hot brew $4.25
Latte 4.75
Mocha 4.99
Cold brew 3.95
Cappuccino 4.89
Donut 1.50
Create a program in Python to accept input from a customer inquiring what item they would like to purchase. Customers can purchase more than one item. Test to see if the item they request is in your dictionary – if not display a message that you don’t currently carry that item. Total up the costs of all the items they wish to purchase and then display to them their total bill, including 7% tax.
struct student
{
unsigned short studNum;
string name;
string course;
string yearLevel;
string section;
}
Write a statement that asks the user to enter the year and convert it to an integer. Store the resulting information in a variable called year.
Write a program named question6c.cpp that demonstrates the use of the following functions. A C++ function named
getName()prompts the user for two string values; first name and last name and return a combination of the two as
one value. The second function getHours()calculate employee’s weekly pay, it must receive one argument,
fullName, a stringvariable and a floatvalue for the rate. It must then prompt the user for hours worked for each
day of the week, i.e. Monday – Friday and calculates the weekly pay. Employees who have worked more than 40 hours
that week will receive a bonus of 10% and those who have worked less than 40 hour will receive 10% less pay for that
week.
To qualify for an International Conference for Women in Computing (ICWC) next year in Toronto, Canada a student have got a distinction (a mark greater than 75) in PRG510S, be a female, and below the age of 25. Write a simple program that receives a mark, gender, and age from the keyboard and displays a corresponding message basing on the input.
Sample Run 1:
Mark: 70
Gender: female
Age: 21
Output1: Unfortunately you do not qualify!
Sample Run 2
Mark: 83
Gender: female
Age: 21
Output2: Congratulations! You might be in Toronto, Canada next year for ICWC!