Programming Fundamentals BSCS 3 Semester/Term UOG — University of Gujrat 2023
Discussion
Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.
No questions yet — be the first to ask.
Need a paper or stuck on a question? Ask here — students reply and you get an email.
Ask about a paper-
ICT 1st sister paper
0 replies Reply → -
BS Islamic Studies, 5th semester, ISL-511 Translation of Holy Quran (3) — Government College University Faisalabad (GCU…
0 replies Reply → -
Civics course code GCCE101
1 reply Reply → -
BS 4the semester2025 civics and community engagement past paper According UOs
0 replies Reply → -
Bs public administration 1st semester mid term past papers
0 replies Reply →
Paper text
University of Gujrat
Programming Fundamentals
Teacher: Ehtisham Rasheed
Course Code: CS-102
Fall-2023
Time: 1:30 hrs
Total Marks: 25
Mid Term
BSCS (3rd Semester)
Q1. Assume that k is an integer variable and a is a real variable. What should be the value of following
expressions?
[3]
i) k = 9 / 2.0
ii) a = 9 / 2.0
iii) a = 9.0 / 2.0
Q2. Suppose that i is an int variable with value -5 and j is an integer variable with value
3. Write the results of
the following expressions?
[3]
i) ((i > -5) || (j < 2))
ii) !(i + 8 < j)
iii) (i > j)
Q3. The distance between two cities (in km) is input through keyboard. Write a program to convert and print
this distance in meters, feet, and miles. The result must have answers with two decimal places.
[6]
[Hint: 1km = 1000 meters, 1km = 3281 feet 1km = 0.621 miles]
Q4. If cost-price and selling-price of an item is input through keyboard, write a program to determine whether
the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. [6]
Q5. Write a program which keeps taking input from user until he enters -1. On receiving -1 your program will
display the average of numbers entered.
[7]