Just post is a new courier service company which services all provinces in the South Africa. They charge their customers based on the weight of the parcel as indicated in the table below. However, if kilograms are above 50, the cost is charged according to the number of hours it took to deliver. Although the time is entered in minutes but they are charged R95.00 per hour. Clients may also add some extras to the delivery such as insurance which is charged 8.5% and priority is charged at 5% of the charge. Table 1: Distance Weight Cost (R) Local Under 5 kg R125.00 Local 5 kg up to 20 kg R175.00 Local Over 20 Kg R250.00 Long Under 5 kg R390.00 Long 5 kg up to 20 kg R450.00 Write a program that will assist with calculating the postage amount.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Just post is a new courier service company which services all provinces in the South Africa. They charge
their customers based on the weight of the parcel as indicated in the table below. However, if kilograms
are above 50, the cost is charged according to the number of hours it took to deliver. Although the time
is entered in minutes but they are charged R95.00 per hour. Clients may also add some extras to the
delivery such as insurance which is charged 8.5% and priority is charged at 5% of the charge.
Table 1:
Distance Weight Cost (R)
Local Under 5 kg R125.00
Local 5 kg up to 20 kg R175.00
Local Over 20 Kg R250.00
Long Under 5 kg R390.00
Long 5 kg up to 20 kg R450.00
Write a program that will assist with calculating the postage amount.

| programs.
Question 2
[48 Marks]
Just post is a new courier service company which services all provinces in the South Africa. They charge
their customers based on the weight of the parcel as indicated in the table below. However, if kilograms
are above 50, the cost is charged according to the number of hours it took to deliver. Although the time
is entered in minutes but they are charged R95.00 per hour. Clients may also add some extras to the
delivery such as insurance which is charged 8.5% and priority is charged at 5% of the charge.
Table 1:
Cost (R)
Weight
Under 5 kg
Distance
Local
R125.00
5 kg up to 20 kg
Over 20 Kg
Local
R175.00
Local
R250.00
Long
Under 5 kg
R390.00
Long
5 kg up to 20 kg
R450.00
Write a program that will assist with calculating the postage amount.
2.1 Create a C++ source file called Postage and save it in a file called Postage.cpp.
2.2 Create the following functions:
Functions:
Function
Description
This function will receive five parameters that will consists of
the minutes, the weight of a parcel, the distance, a status
indicate if the parcel is a priority and if it will be insured.
Marks
2.2.1 enterPostageDetails()
3
The function will then prompt the user for the following as
indicated in Figure 2.1 and Figure 2.2:
the minutes,
the weight of a parcel, the distance,
priority (Y/y Or N/n) and an insurance indication (Y/y
Or N/n).
4
DSO17BT Web Test 3 20202
2.2.2 determineCost()
This function will receive three parameter that will consists of 11
the distance, weight and time in hours.
The function must then determine and return the postage cost
for that particular distance using the information above and
the information on Table 1.
2.2.3 convertTime()
This function will receive one parameter that will consists of 7
the delivery time in minutes.
This function must then convert the given time from minutes
to hours and it must then return the number of hours in that
given time.
This function will receive six parameter that will consists of the 7
2.2.4 calcAmtDue()
postage cost, an indication whether the insurance is the taken
and whether the parcel is priority or not, the insurance
amount, priority amount as well as the amount due.
This function must then calculate the insurance, priority
amount and the amount due respectively.
Add necessary pre-processor directives.
NB: The functions must be implemented below the main.
2.2.5 main()
20
Declare all necessary constants and variables.
•
Allow the program to randomly generate an invoice
number, the range must be from 105 to 550.
• Prompt the user for the postage details by calling the
correct function.
Calculate the postage cost as well as the amount due
by calling the correct functions.
Display the postage details as indicated in Figure 2.3
and Figure 2.4.
This process must be repeated until there are no
parcels to deliver (See Figure 2.4).
Display the number of deliveries for both Local or
Long distances and the total revenue when the
Transcribed Image Text:| programs. Question 2 [48 Marks] Just post is a new courier service company which services all provinces in the South Africa. They charge their customers based on the weight of the parcel as indicated in the table below. However, if kilograms are above 50, the cost is charged according to the number of hours it took to deliver. Although the time is entered in minutes but they are charged R95.00 per hour. Clients may also add some extras to the delivery such as insurance which is charged 8.5% and priority is charged at 5% of the charge. Table 1: Cost (R) Weight Under 5 kg Distance Local R125.00 5 kg up to 20 kg Over 20 Kg Local R175.00 Local R250.00 Long Under 5 kg R390.00 Long 5 kg up to 20 kg R450.00 Write a program that will assist with calculating the postage amount. 2.1 Create a C++ source file called Postage and save it in a file called Postage.cpp. 2.2 Create the following functions: Functions: Function Description This function will receive five parameters that will consists of the minutes, the weight of a parcel, the distance, a status indicate if the parcel is a priority and if it will be insured. Marks 2.2.1 enterPostageDetails() 3 The function will then prompt the user for the following as indicated in Figure 2.1 and Figure 2.2: the minutes, the weight of a parcel, the distance, priority (Y/y Or N/n) and an insurance indication (Y/y Or N/n). 4 DSO17BT Web Test 3 20202 2.2.2 determineCost() This function will receive three parameter that will consists of 11 the distance, weight and time in hours. The function must then determine and return the postage cost for that particular distance using the information above and the information on Table 1. 2.2.3 convertTime() This function will receive one parameter that will consists of 7 the delivery time in minutes. This function must then convert the given time from minutes to hours and it must then return the number of hours in that given time. This function will receive six parameter that will consists of the 7 2.2.4 calcAmtDue() postage cost, an indication whether the insurance is the taken and whether the parcel is priority or not, the insurance amount, priority amount as well as the amount due. This function must then calculate the insurance, priority amount and the amount due respectively. Add necessary pre-processor directives. NB: The functions must be implemented below the main. 2.2.5 main() 20 Declare all necessary constants and variables. • Allow the program to randomly generate an invoice number, the range must be from 105 to 550. • Prompt the user for the postage details by calling the correct function. Calculate the postage cost as well as the amount due by calling the correct functions. Display the postage details as indicated in Figure 2.3 and Figure 2.4. This process must be repeated until there are no parcels to deliver (See Figure 2.4). Display the number of deliveries for both Local or Long distances and the total revenue when the
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Public key encryption
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education