Question 4 a) Program Z is used to summarize saie of a caté owner for a week. By using array, write a JAVA program to calculate and displav: Total sale • Average sale • Number of sale that is above average • The highest sale The lowest sale • Display "TOTAL SALE IS NOT ENOUGH." if total sale is less than 25000. Else, di splay "BUSINESS ARE PROFITABLE The following is a sample input-output to guide the program design: Sample Input Enter sales: RM 10000 Sample Output Total sale for a week : 49900 Average sale for a week : 7128.5714 Number of sale that is above average The highest sale in a week : 11000 The lowest sale in a week : 900 BUSINESS ARE PROFITABLE. Enter sales: RM 8000 Enter sales: RM 9000 Enter sales: RM 11000 Enter sales: RM 900 Enter sales: RM -1500 PLEASE ENTER POSITIVE VALUE Enter sales: RM 10000 Enter sales: RM 1000 b) Write a JAVA program to salve the tasks below: • Ask the user to input a series of number(enter 0 to stop). • Calculate the sum of all positive numbers. • Count the number of even numbers • Count the numbers that are divisible by 3. Example : User Input : 3 4 7 -11 9 12 -13 18 20 17 0 The sum of all positif numbers is : 90 Total even number : 4 Total number divisible by : 4
Question 4 a) Program Z is used to summarize saie of a caté owner for a week. By using array, write a JAVA program to calculate and displav: Total sale • Average sale • Number of sale that is above average • The highest sale The lowest sale • Display "TOTAL SALE IS NOT ENOUGH." if total sale is less than 25000. Else, di splay "BUSINESS ARE PROFITABLE The following is a sample input-output to guide the program design: Sample Input Enter sales: RM 10000 Sample Output Total sale for a week : 49900 Average sale for a week : 7128.5714 Number of sale that is above average The highest sale in a week : 11000 The lowest sale in a week : 900 BUSINESS ARE PROFITABLE. Enter sales: RM 8000 Enter sales: RM 9000 Enter sales: RM 11000 Enter sales: RM 900 Enter sales: RM -1500 PLEASE ENTER POSITIVE VALUE Enter sales: RM 10000 Enter sales: RM 1000 b) Write a JAVA program to salve the tasks below: • Ask the user to input a series of number(enter 0 to stop). • Calculate the sum of all positive numbers. • Count the number of even numbers • Count the numbers that are divisible by 3. Example : User Input : 3 4 7 -11 9 12 -13 18 20 17 0 The sum of all positif numbers is : 90 Total even number : 4 Total number divisible by : 4
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
Related questions
Question
Question 4

Transcribed Image Text:Question 4
a) Program Z is used to summarize saie of a caté owner for a week. By using array, write a JAVA program to calculate and displav:
Total sale
• Average sale
• Number of sale that is above average
• The highest sale
• The lowest sale
• Display "TOTAL SALE IS NOT ENOUGH." if total sale is less than 25000. Else, display "BUSINESS ARE
PROFITABLE
• The fallowing is a sample input-output to guide the program design:
Sample Input
Enter sales: RM 10000
Sample Output
Total sale for a week : 49900
Average sale for a week : 7128.5714
Enter sales: RM 8000
Enter sales: RM 9000
Number of sale that is ab
ve average: 5
Enter sales: RM 11000
The highest sale in a week : 11000
Enter sales: RM 900
The lowest sale in a week : 900
Enter sales: RM -1500
BUSINESS ARE PROFITABLE.
PLEASE ENTER POSITIVE VALUE
Enter sales: RM 10000
Enter sales: RM 1000
b) Write a JAVA program to salve the tasks below:
• Ask the user to input a series of number(enter 0 to stop).
• Calculate the sum of all positive numbers.
• Count the number of even numbers
• Count the numbers that are divisible by 3.
Example :
User Input : 3 4 7 -11 9 12 -13
18
20 17 0
The sum of all positif numbers is : 90
Total even number : 4
Total number divisible by : 4
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 5 images

Knowledge Booster
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
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education