Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

D278 practice exam 1 Questions and Correct Answers

Rating
-
Sold
-
Pages
11
Grade
A+
Uploaded on
02-07-2026
Written in
2025/2026

D278 practice exam 1 Questions and Correct Answers

Institution
D278
Module
D278

Content preview

D278 practice exam 1 Questions and Correct
Answers
A bus driver starts a route with 12 passengers. At the first stop, 4 passengers get on and 3

get off. What is the value of numPassengers after the first stop?

13

A program tracks the number of books returned to a library. The variable returnedBooks

should hold a count value. Which data type should the variable be?

Integer

A baker's recipe uses a fixed sugar-to-flour ratio of 0.4 in many calculations. How should

the item that holds this ratio be declared?

Constant float sugarFlourRatio

Given integer a = 6 and integer b = 4. What is the value of the expression (a / 2.0) + b?

7.0

Given float p = 8.4 and float q = 2.0. What is the value of the expression p / q?

4.2

What kind of operator is the != in the expression count != 10?

Relational (inequality)

A program is checking whether userScore is between 70 and 89 inclusive (a B grade range).

Which expression correctly captures this range?

, (userScore >= 70) and (userScore <= 89)

Which operator should be used to determine if a number is evenly divisible by 3?

%

Which data type is used to track a person's exact weight in pounds?

Float

A weather program needs to determine if it is currently raining (true or false). Which data

type should be used for that variable?

Boolean

Given integer x = 8 and integer y = 3. What is the value of the expression (x % y) + (x / y)?

4

A movie theater offers a senior discount with the following logic: if customerAge >= 65 then

ticketPrice = 8, else ticketPrice = 12. Given customerAge = 70, what is the final value of

ticketPrice?

8

A delivery service charges extra for heavy packages with the following logic: if

packageWeight > 50 then fee = 25, else fee = 10. If packageWeight is 45, which branch

executes?

else (false) branch

A program should prompt the user to enter test scores and continue accepting scores until

the user enters -1 to stop. Which control structure should be used?

Written for

Institution
D278
Module
D278

Document information

Uploaded on
July 2, 2026
Number of pages
11
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

£10.79
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
KenAli West Virginia University
Follow You need to be logged in order to follow users or courses
Sold
96
Member since
2 year
Number of followers
5
Documents
18146
Last sold
1 month ago

2.6

18 reviews

5
2
4
4
3
4
2
0
1
8

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions