In this program you must use pointer notation with the array name! This program will processes an array of data. The data shown in Table 1 is a TOP 5 states for COVID 19 cases recorded in Malaysia until 18 May 2021. In the same time, the total cases for all state in Malaysia is 479,421 cases. That's mean, Selangor contribute about 32% cases in Malaysia and Sabah, 12% and so on. You need to write a C++ program by applying array and pointers to inputting the number of cases, calculate and display the percentage for each state. Show your full codes and output display. Table 1 State Cases % 1 Selangor 152,000 32% 2 Sabah 59,262 12% 3 Johor 50,195 10% 4 Kuala Lumpur 49,466 10% 5 Penang 23,591 5%

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

Program in C++

In this program you must use pointer notation with the array name! This program will
processes an array of data.
The data shown in Table 1 is a TOP 5 states for COVID 19 cases recorded in Malaysia until
18 May 2021. In the same time, the total cases for all state in Malaysia is 479,421 cases. That's mean,
Selangor contribute about 32% cases in Malaysia and Sabah, 12% and so on.
You need to write a C++ program by applying array and pointers to inputting the number of
cases, calculate and display the percentage for each state.
Show your full codes and output display.
Table 1
State
Cases
%
1
Selangor
152,000
32%
2
Sabah
59,262
12%
3 Johor
50,195 10%
4 Kuala Lumpur
49,466
10%
5
Penang
23,591 5%
Transcribed Image Text:In this program you must use pointer notation with the array name! This program will processes an array of data. The data shown in Table 1 is a TOP 5 states for COVID 19 cases recorded in Malaysia until 18 May 2021. In the same time, the total cases for all state in Malaysia is 479,421 cases. That's mean, Selangor contribute about 32% cases in Malaysia and Sabah, 12% and so on. You need to write a C++ program by applying array and pointers to inputting the number of cases, calculate and display the percentage for each state. Show your full codes and output display. Table 1 State Cases % 1 Selangor 152,000 32% 2 Sabah 59,262 12% 3 Johor 50,195 10% 4 Kuala Lumpur 49,466 10% 5 Penang 23,591 5%
The sample of output as shown in Figure 1. However, you can design your own output
display arrangement.
Enter the NAME of 5 states.
State 1 cases : Selangor
State 2 cases : Sabah
State 3 cases: Johor
State 4 cases : Kuala Lumpur
State 5 cases: Penang
Enter the number of cases for 5 states.
State Selangor cases: 152000
State Sabah cases : 59262
State Johor cases: 50195
State Kuala Lumpur cases : 49466
State Penang cases : 23591
State Selangor cases: 152000.00[ 31.70% ]
State Sabah cases: 59262.00 [ 12.36% ]
State Johor cases: 50195.00[ 10.47% ]
State Kuala Lumpur cases : 49466.00[ 10.32% ]
State Penang cases : 23591.00[ 4.92% ]
Figure 1
Transcribed Image Text:The sample of output as shown in Figure 1. However, you can design your own output display arrangement. Enter the NAME of 5 states. State 1 cases : Selangor State 2 cases : Sabah State 3 cases: Johor State 4 cases : Kuala Lumpur State 5 cases: Penang Enter the number of cases for 5 states. State Selangor cases: 152000 State Sabah cases : 59262 State Johor cases: 50195 State Kuala Lumpur cases : 49466 State Penang cases : 23591 State Selangor cases: 152000.00[ 31.70% ] State Sabah cases: 59262.00 [ 12.36% ] State Johor cases: 50195.00[ 10.47% ] State Kuala Lumpur cases : 49466.00[ 10.32% ] State Penang cases : 23591.00[ 4.92% ] Figure 1
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Array
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.
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