Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5 An engineering firm wishes to keep track of their quarterly revenue (sales) and gross profits. Below are the revenue and gross profit for

image text in transcribed

Question 5 An engineering firm wishes to keep track of their quarterly revenue (sales) and gross profits. Below are the revenue and gross profit for the year of 2018: Quarter: Q1 (Jan-Mar) Q2 (Apr-Jun) Q3 (Jul-Sep) Q4 (Oct-Dec) Revenue (000's) RM 2000 RM 4000 RM 3000 RM 1000 Profit (000's) RM 400 RM 1000 RM 700 RM 500 For simplified accounting, the company has decided to calculate net profits by subtracting the average working expenses of RM 200 from each quarter, and the company would like to know which quarter has the lowest revenue. Write a program that applies arrays and loop structures to perform the following: (a) Declare the array of revenue and initialize it with the revenue for the four quarters (ie 2000, 4000, 3000, and 1000) (b) Declare the array of profit and apply a loop structure to prompt the user to enter the profit values for the four quarters in 2018. (c) Declare the array of netProfit and apply a loop structure to subtract RM200 from the profit array, then store the net profit in the netProfit array. (d) Apply a loop structure to identify and display the quarter with the lowest revenue. Below is an example of how the output displayed should look like: Q4 has the lowest revenue of RM 1000 The corresponding profit was RM 500 Note: you may assume all necessary libraries are already #included for your answer. (20 marks) (Total: 20 marks)

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

WHAT IS AUTOMATION TESTING?

Answered: 1 week ago

Question

What is Selenium? What are the advantages of Selenium?

Answered: 1 week ago