logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

Compare Program Segment A and Program Segment B. Which segment program is more efficient?

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1. Compare Program Segment A and Program Segment B. Which segment program is more efficient? Justify your answer.

(Bandingkan Program Segment A dan Program Segment B. Segmen program yang manakah lebih efisyen? Berikan justifikasi untuk jawapan anda.)

[4 marks]

2. Permata Childcare Centre imposed charges for caring services based on the child age. The charge for children aged 2 years to less than 5 years old is RM180 per month and RM150 for children aged 5 years to less than 7 years old. While charges for child below 2 years old is RM250 per month. Create a program segment for this problem.

(Pusat penjagaan Permata Child Care mengenakan bayaran jagaan berdasarkan umur kanak-kanak. Bayaran yang dikenakan ialah RM180 perbulan bagi kanak-kanak yang berumur 2 tahun hingga kurang dari 5 tahun dan RM150 bagi kanak-kanak yang

 berumur 5 tahun hingga kurang dari 7 tahun. Manakala bayaran bagi kanak-kanak berumur 2 tahun ke bawah ialah RM250 sebulan. Bina segmen atur cara untuk masalah ini.)

[4 marks]

3. Let us that 40 students have assessed a lecturer where students are required to give either grade A, B, C or D. The assessment marks given to each grade are as shown in Table 1.

(Seramai 40 orang pelajar telah membuat penilaian terhadap seorang pensyarah di mana pelajar dikehendaki memberi sama ada gred A, B, C atau D. Markah penilaian yang diberikan kepada setiap gred adalah seperti dalam Table 1.)

Table 1: Grades and marks

Grade Mark

A 4

B 3

C 2

D 1

 

Using the switch statement, complete the blank space in Program A below to calculate the total score obtained by a lecturer.

(Dengan menggunakan pernyataan switch, lengkapkan ruang kosong dalam Program A di bawah untuk mengira jumlah markah yang diperolehi oleh seorang pensyarah.)

 [6 marks]

4. Adam Sdn Bhd Company has 100 employees. Each employee is paid based on the numbers of working hours and their positions as shown in Table 2. A declaration of employee’s information is shown in Program Segment C. By referring to this declaration, answer question a, b and c.

(Syarikat Adam Sdn Bhd mempunyai 100 pekerja. Setiap pekerja dibayar gaji berdasarkan jam bekerja dan jawatan mereka seperti yang ditunjukkan dalam Table 2. Pengisytiharan bagi maklumat pekerja ditunjukkan dalam Program Segment C. Dengan merujuk kepada pengisytiharan tersebut, jawab soalan a, b dan c)

 

Table 2: Working hour rate with position respectively

Position Rate/hour

Supervisor (S) 20/hour

Assistant Supervisor (A) 15/hour

Operator (O) 8/hour

a. Write a program segment to input data into the arrays declared in Program Segment C.

(Tuliskan segmen atur cara untuk menginput data ke dalam tatasusunan yang telah diisytiharkan dalam Program Segment C.)

[3 marks]

b. Write a program segment to calculate salary for each employee and store this information in the array.

(Tuliskan segmen atur cara untuk mengira gaji untuk setiap pekerja dan simpan maklumat ini dalam tatasusunan.)

[4 marks]

c. Write a program segment to display employee number, position and salary earned by each employee.

(Tuliskan segmen atur cara untuk memaparkan no pekerja, jawatan dan gaji yang diperolehi oleh setiap pekerja.)

[3 marks]

 5. For each sale, the salesperson will earn 20% of the commission from the sale price. If the sales amount exceeds RM25,000, an allowance of RM1000 will be given. Program B is to calculate commissions for each sale. The program will calculate and display the total amount of commission earned along with the allowance if any. Study Program B to answer questions a and b.

(Untuk setiap jualan, jurujual akan memperoleh 20% komisyen daripada harga jualan. Jika jumlah jualan melebihi RM25,000, elaun sebanyak RM1000 akan diberikan. Program B adalah untuk mengira komisyen bagi setiap jualan. Program ini akan mengira dan memaparkan jumlah keseluruhan komisyen yang diperoleh beserta dengan elaun jika ada.  Kaji Program B untuk menjawab soalan a dan b.)

 

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

915 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

932 Answers

Hire Me
expert
Husnain SaeedComputer science

818 Answers

Hire Me
expert
Atharva PatilComputer science

738 Answers

Hire Me