0% found this document useful (0 votes)
1 views3 pages

Lab 1

The document outlines Lab 1 for INFO 1112, which consists of seven programming problems to be completed using C++. Each problem has specific requirements regarding file naming, input/output operations, and calculations, including displaying names, calculating gas mileage, ticket sales income, gender percentages, currency conversions, and creating a math tutor and word game. Students are instructed to organize their work in a designated folder on AWS Cloud9 and adhere to proper coding standards.

Uploaded by

Sime Purewal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views3 pages

Lab 1

The document outlines Lab 1 for INFO 1112, which consists of seven programming problems to be completed using C++. Each problem has specific requirements regarding file naming, input/output operations, and calculations, including displaying names, calculating gas mileage, ticket sales income, gender percentages, currency conversions, and creating a math tutor and word game. Students are instructed to organize their work in a designated folder on AWS Cloud9 and adhere to proper coding standards.

Uploaded by

Sime Purewal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

INFO 1112

Lab 1

Total marks: 10

Before you begin:


1. Create a folder called Lab1 on your AWS Cloud9 environment. Save all your work in this folder.
2. Follow the required filename
3. Have proper indentations

Problem 1:

 Filename: prob1_yourstudentid.cpp
 Requirement(s):
o Write an application to display your name using cout then use endl to skip a line after
the display.

Problem 2:

 Filename: prob2_yourstudent id.cpp


 Write a program that calculates a car’s gas mileage. The program should ask the user to enter
the number of gallons of gas the car can hold, and the number of miles it can be driven on a full
tank. It should then display the number of miles that may be driven per gallon of gas.
o cout and cin (for the user inputs)
o data type: use double

Problem 3:

 Filename: prob3_yourstudentid.cpp
 There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class
B seats cost $12, and Class C seats cost $9. Write a program that asks how many tickets for each
class of seats were sold, then displays the amount of income generated from ticket sales.
Format your dollar amount in fixed-point notation, with two decimal places of precision, and be
sure the decimal point is always displayed.
o cout, cin, int, double, arithmetic, fixed, setprecision, showpoint

Problem 4:

 Filename: prob4_yourstudentid.cpp
 Write a program that asks the user for the number of males and the number of females
registered in a class. The program should display the percentage of males and females in the
class.

Hint: Suppose there are 8 males and 12 females in a class. There are 20 students in the class.
The percentage of males can be calculated as 8 ÷ 20 = 0.4, or 40 percent. The percentage of
females can be calculated as 12 ÷ 20 = 0.6, or 60 percent.
o cout, cin, int, double, arithmetic, setw, setprecision
INFO 1112
Lab 1

Problem 5:

 Filename: prob5_yourstudentid.cpp
 Write a program that will convert U.S. dollar amounts to Japanese yen and to euros, storing the
conversion factors in the constants YEN_PER_DOLLAR and EUROS_PER_DOLLAR. To get the
most up-to-date exchange rates, search the Internet using the term “currency exchange rate”.
o 1 Dollar = 131.66 Yen
o 1 Dollar = 0.93 Euros

Format your currency amounts in fixed-point notation, with two decimal places of precision, and
be sure the decimal point is always displayed.
o Const, double, cout, cin, arithmetic, fixed, setprecision, showpoint

Problem 6:

 Filename: prob6_yourstudentid.cpp
 Write a program that can be used as a math tutor for a young student. The program should
display two random numbers to be added, such as
INFO 1112
Lab 1

Problem 7: [4 marks]

 Filename: prob7_yourstudentid.cpp
 Write a program that plays a word game with the user. The program should ask the user to
enter the following:
o His or her name
o His or her age
o The name of a city
o The name of a college
o A profession
o A type of animal
o A pet’s name

After the user has entered these items, the program should display the following story, inserting
the user’s input into the appropriate locations:

You might also like