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

Assignment 01 PF Fall2022

This document contains instructions for Assignment 01 for a programming fundamentals course. It provides 10 programming questions to answer, covering topics like printing numbers with separators, generating tables from data, currency conversion, temperature conversion, and calculating miles per gallon and total calories. It advises students to show all code, screenshots, and follow academic integrity policies. It notes that assignments are due by a specified deadline.

Uploaded by

Abdullah Mirza
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)
51 views3 pages

Assignment 01 PF Fall2022

This document contains instructions for Assignment 01 for a programming fundamentals course. It provides 10 programming questions to answer, covering topics like printing numbers with separators, generating tables from data, currency conversion, temperature conversion, and calculating miles per gallon and total calories. It advises students to show all code, screenshots, and follow academic integrity policies. It notes that assignments are due by a specified deadline.

Uploaded by

Abdullah Mirza
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

Assignment 01

Programming Fundamentals-CS-1104, Fall 2022


BSCS-1A/BSCS-1B/BSGM-1A/BSROB-1A
Department of Computer Science,
Faculty of Computer Science & Information Technology,
The Superior University Gold Campus, Lahore.
Submission Deadline: Thursday 11:59 PM, December 12, 2022
____________________________________________________________
Questio CLO Domian/BT Level Total Marks
n
1-10 3 C3 100

Advice and Submission Guidelines for Assignment

 Make sure that you read and understand each and every instruction. If you have any questions or
comments you are encouraged to discuss (only) with your colleagues and instructor.
 In case of coding assignment, paste all codes and screenshots of output on word file, later you can
convert this word file into PDF file as well. Upload PDF file on the LMS and keep code files with you
(better in your own email) as it will be used for evaluation and viva.
 Handwritten assignment shall be submitted in class.
 All the submitted evaluation instruments (quizzes, assignments, lab work, exams, and the project) will
be checked for plagiarism.
 Later Submission and Plagiarism will be dealt as per university Policy
 Start early otherwise you will struggle with the assignment.

Note: Keep all your code files. It will be required at any time of evaluation.

Question 01: (10 Points)


Write a program that prints the numbers 1 to 4 on the same line with each pair of adjacent numbers separated by
one space. Do this several ways:
a) Using one statement with one stream insertion operator.
b) Using one statement with four stream insertion operators.
c) Using four statements.
Question 02: (10 Points)
Write a program that generates the following table:
1990 135
1991 7290
1992 11300
1993 16200
Use a single cout statement for all output.
Question 03: (10 Points
On a certain day the British pound was equivalent to $1.487 U.S., the French franc was $0.172, the German
deutschemark was $0.584, and the Japanese yen was $0.00955. 1Write a program that allows the user to enter
an amount in British pound, and then displays this value converted to these four other monetary units.

Question 04: (10 Points)


You can convert temperature from degrees Celsius to degrees Fahrenheit by multiplying by 9/5 and adding
32. Write a program that allows the user to enter a floating-point number representing degrees Celsius, and then
displays the corresponding degrees Fahrenheit.

Question 05: (10 Points


Miles per Gallon
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.

Question 06: (10 Points)


Stadium Seating
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.

Question 07: (10 Points


Average Rainfall
Write a program that calculates the average rainfall for three months. The program should ask the user to enter
the name of each month, such as June or July, and the amount of rain (in inches) that fell each month. The
program should display a message similar to the following:
The average rainfall for June, July, and August is 6.72 inches.

Question 08: (10 Points)


How Many Calories?
A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 “servings” in
the bag and that a serving equals 300 calories. Write a program that asks the user to input how many cookies
he or she actually ate and then reports how many total calories were consumed.

Question 09: (10 Points)


Automobile Costs
Write a program that asks the user to enter the monthly costs for the following expenses incurred from
operating his or her automobile: loan payment, insurance, gas, oil, tires, and maintenance. The program
should then display the total monthly cost of these expenses, and the total annual cost of these expenses
Question 10: (10 Points)

Write a program to print the following poem by using suitable escape sequences.

A time has come


and it is now.
Will you take a stand
or bend your knee and bow?

Will you state your case?


Will you run this race
or turn in disgrace,
try to hide your face?

You've spoken the word,


and by many were heard.
Now what will you do
when it's left up to you?

Will you act out your faith


in the midst of a trial?
Will you do what is right?
Will you put up a fight?

Be a blessing to others;
help your sisters and brothers.
Care for those in need.
Help multiply their seed.

Be gracious and faithful.


Be fair and be true,
looking not unto others.
Let the change come through you…

You might also like