Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

input: proses: Output: PART B: SELECTION (SINGLE) 1 If a student is in Modul 2 group, display the message The student is taking Computer Science

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

input: proses: Output:

PART B: SELECTION (SINGLE) 1 If a student is in Modul 2 group, display the message "The student is taking Computer Science subject". Input : Modul Process : Output : Messaye" the strdent is taking Computer Pcience Sugect 2 Create a program that will accept student's name and age. If the student's age is below 45, the program will print a message "You are eligible to take a PhD programme". Input Process : Output : 3 Display a message "You are an excellent student" for a student whose cumulative grade point average (CGPA) is 3.75 or above. Input Process : Output : Calculate the BMI of a person if height value entered is not zero. Input Process Output : 5 Calculate the area of a circle if the radius entered is a positive value. Input Process Output : PART C: SELECTION (DUAL) 1 If a student is in Modul 2 group, display the message "The student is taking Computer Science subject". Otherwise, display the message "The student is taking Biology subject". Input Process : Output : 2 Determine whether a number entered by a user is an even or odd number Input Process : Output : 3 MyHealth magazine is sold at RM5 each if at least 5 units of the magazine are purchased, and it is sold at the price of RM7 each otherwise. Calculate the price a customer has to pay after he enters the quantity of the magazines that he purchased. Input Process : Output : 4 A program will asks user to enter age for two peoples, where the values entered will be stored in variables age l and age2. Display "The first person is older" when agel is greater than age2, else display "The second person is older". Input Process Output : Calculate BMI when a user enters weight and height. Print "Please reduce your weight" if BMl is greater and equal to 25.0. If not, print "You have an ideal weight". Input Process : Output : A customer who rents a car will be charged RM60 if he rents for only 24 hours or less. Otherwise, RM5 per hour will be charged for additional hours. Calculate and display the charge of a car rental. Input Process : Output : An allowance for a part time lecturer will be paid monthly based on the total lecture hours per month. Payment rate is as follows: First12hoursAdditionalhours-RM100perhour-RM50perhour Calculate the monthly allowance for a part time lecturer. Input Process Output : Calculate electric bill based on the electricity usage in watt as given below: Usage up to 1000 watt_ - charge is 20 cents per watt. Additional usage after 1000 watt - charge is 10 cents per watt. Input Process : Output : ART D: SELECTION (MULTIPLE) Determine whether the number keyed in by user is positive, negative or zero. Input : Process : Output : Create a program that will ask a user to enter age for two people. Display "The first person is older" when age 1 is greater than age2, else display "The second person is older". If both are not true, display "Both person are same age". Input Process : This program prompts a user to key in a number as a choice for his/her favorite holiday destination. If the choice is 1 , it will display "Pulau Langkawi". If the choice is equal to 2, it will display "Cameron Highland". If the choice is 3, it will display "Genting Highland", and it will display "Bukit Merah" if the choice is equal to 4. Otherwise, a message "Your choice is not in the list" will be displayed. Input Process : Output : 4 The products listed below are sold in a convenience store: 6 A program will be assigned based on the value of a code. Display the name of the program that will be assigned based on the following table. Input Process Output Calculate water bill based on water consumption as given below: Usage first 20m3 charge is 40 cents per m3 Additional 20m3 charge is 20 cents per m3 Extra usage charge is 10 cents per m3 Input Process Output 8 Calculate phone bill based on the following term: Usage less than RM50 per month - no discount will be given Usage less than RM100 per month - get 5% discount Usage RM100 above per month - get 20% discount Input Process Output Read and determine the smaller and larger between two numbers. Print the smaller number followed by the larger number if they are not equal. Otherwise, print the message "The numbers are equal". Input Process : Output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

Describe the true score model.

Answered: 1 week ago

Question

What is meant by systematic and unsystematic risk?

Answered: 1 week ago

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago