LearnFrenzy
Sign in Take a free test

Decision Making · Exercise 4 of 4

Decision Making Decision Making Programs

  • 8 questions
  • Page 1 of 1
  • Answers explained
0Attempted
0Correct
0Wrong
Directions

Programs where getting the conditions right is the whole job. Write each one yourself first, then open the solution – every solution was compiled and run, and the output shown is the real output.

Question 1 Easy

Find the largest of four integers using simple comparisons.

Question page & discussion
Question 2 Easy

Count the vowels in a word using one combined condition (no switch).

Question page & discussion
Question 3 Medium

Decide each student's result: distinction (marks ≥ 75 and attendance ≥ 75), pass (marks ≥ 40 and attendance ≥ 75), detained (marks ≥ 40 but low attendance), otherwise fail.

Question page & discussion
Question 4 Easy

Report the quadrant of a point, or whether it lies on an axis or at the origin.

Question page & discussion
Question 5 Medium

The sides may be given in any order. Decide whether they form a right-angled triangle.

Question page & discussion
Question 6 Medium

Check whether strings such as "23:59:59" are valid 24-hour times.

Question page & discussion
Question 7 Medium

Discount depends on the cart total (below Rs. 1000: 0%, up to 4999: 5%, from 5000: 10%) and membership (+5% for members). Compute the final amounts with a table.

Question page & discussion
Question 8 Hard

Print FizzBuzz for 1 to 15 without using %: decide with counters instead.

Question page & discussion
All exercises doneBack to Decision MakingRevise the concepts or pick another topic

Ready to test your Programming?

Timed online tests with instant scores and explanations.

Search LearnFrenzy

Esc

Quick links