2. Write a program that will read a number and will display the factors of the number. Factors are numbers that can divide the given number exactly, or they are numbers that when multiplied will result to the number. For example, if the given number is 6, its factors are 1, 2, 3 and 6. When you multiply 1 and 6 it will result to 6 and so is multiplying 2 and 3. Number 6 can also be divided exactly by the numbers 1, 2, 3 and 6.

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
1. A mall in Oman wants you to create a program that they can use to
compute for the discounts to be given to shukran card holders.
The program should prompt the user to enter the name of the
customer and the number of purchases. The number of purchases
will serve as the counter for the number of times purchase amount
will be entered by the user. The program should be able to count
the number of purchase amounts in each of the following ranges:
•1 to 10
• 11 to 30
• Above 30
The program should also compute the sum of all the purchase
amounts. A discount is computed based on the sum of the
purchase amount. If the sum of the purchase is more than 500, the
discount is 2.5% of the sum; otherwise, the discount is 5% of the
sum. Display an appropriate output.
2. Write a program that will read a number and will display the
factors of the number. Factors are numbers that can divide the
given number exactly, or they are numbers that when multiplied
will result to the number. For example, if the given number is 6,
its factors are 1, 2, 3 and 6. When you multiply 1 and 6 it will
result to 6 and so is multiplying 2 and 3. Number 6 can also be
divided exactly by the numbers 1, 2, 3 and 6.
3. You are tasked to create a program that will get the basic
salary of 4 employees from the user and these 4 values should
be saved in a list named as basicSalary.
The user will then enter the incentive rate (Example. 0.25)
The program should compute the net salary.
The net salary is computed using the formula basic salary
multiplied by incentive rate. Store the computed net salary in
another list which will be named as net_salary.
Display the values stored in the 2 lists.
4. A mobile phone store wants you to create a simple application. The
program will start by asking the brand of the phone. The user will
then enter 5 different prices of that phone for the past months.
From the prices entered, be able to count the number of price that
is more than 200. Determine also the average price of all the
amount.
Sample output:
Transcribed Image Text:1. A mall in Oman wants you to create a program that they can use to compute for the discounts to be given to shukran card holders. The program should prompt the user to enter the name of the customer and the number of purchases. The number of purchases will serve as the counter for the number of times purchase amount will be entered by the user. The program should be able to count the number of purchase amounts in each of the following ranges: •1 to 10 • 11 to 30 • Above 30 The program should also compute the sum of all the purchase amounts. A discount is computed based on the sum of the purchase amount. If the sum of the purchase is more than 500, the discount is 2.5% of the sum; otherwise, the discount is 5% of the sum. Display an appropriate output. 2. Write a program that will read a number and will display the factors of the number. Factors are numbers that can divide the given number exactly, or they are numbers that when multiplied will result to the number. For example, if the given number is 6, its factors are 1, 2, 3 and 6. When you multiply 1 and 6 it will result to 6 and so is multiplying 2 and 3. Number 6 can also be divided exactly by the numbers 1, 2, 3 and 6. 3. You are tasked to create a program that will get the basic salary of 4 employees from the user and these 4 values should be saved in a list named as basicSalary. The user will then enter the incentive rate (Example. 0.25) The program should compute the net salary. The net salary is computed using the formula basic salary multiplied by incentive rate. Store the computed net salary in another list which will be named as net_salary. Display the values stored in the 2 lists. 4. A mobile phone store wants you to create a simple application. The program will start by asking the brand of the phone. The user will then enter 5 different prices of that phone for the past months. From the prices entered, be able to count the number of price that is more than 200. Determine also the average price of all the amount. Sample output:
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Program on Numbers
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