Professional Documents
Culture Documents
Midterm Lab
Midterm Lab
30 pts.
3. Write a program to input cost price and selling price of a product and check profit or loss.
Also calculate total profit or loss using if else. How to calculate profit or loss on any
product using if else.
Example
Input:
Input cost price: 1000
Input selling price: 1500
Output:
Profit: 500
50pts
1. Create a Program that will input 3 numbers and get the highest number and lowest
number.
80pts
DATE FORMATTER
• Create a Program that will make the user input Month, Date and Year as integers then use
switch statement and concatenation to display it in this format:
• Ex. Output:
Month: 1 - If the user input 13 and above the program will output “Invalid Month”
Date: 13 - if the user input 32 and above the program will output “Invalid Date”
Now if the user input 2 in month and 29 in date check the year if it’s a leap year. Then if not
output “You Input invalid date. The Year you input is not a Leap year!”
Year: 2020