Home /UOG — University of Gujrat /Programming Fundamentals

Programming Fundamentals BSCS 3 Semester/Term UOG — University of Gujrat 2023

Programming Fundamentals BSCS 3 Semester/Term UOG — University of Gujrat 2023 — page 1

Discussion

Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.

Your email is only used to send you replies and occasional Ustadni updates. It is never shown publicly.

Log in to post under your name

No questions yet — be the first to ask.

Need Paper? See all →

Need a paper or stuck on a question? Ask here — students reply and you get an email.

Ask about a paper
  • Danish Yasin· 3 hours ago

    ICT 1st sister paper

    0 replies Reply →
  • Bushra· 1 day ago

    BS Islamic Studies, 5th semester, ISL-511 Translation of Holy Quran (3) — Government College University Faisalabad (GCU…

    0 replies Reply →
  • Khadija· 3 days ago

    Civics course code GCCE101

    1 reply Reply →
  • Tasddaq hussain· 3 days ago

    BS 4the semester2025 civics and community engagement past paper According UOs

    0 replies Reply →
  • Humna Khan· 4 days ago

    Bs public administration 1st semester mid term past papers

    0 replies Reply →
Ad

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]