
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Question b only

Transcribed Image Text:The domestic tariff charged by Sabah Electricity Sdn Bhd (SESB) is given in Table 1. Based on the tariff, write
a C++ program that can do the following:
a. Tell the user to input the monthly usage (in kWh) from January to December.
b. Calculate the consumption, discount, tax, and bill in RM for each month.
For consumption of less than or equal to RM600 per month, a 10% discount is given.
For consumption of more than RM600 per month, a 6% service tax is imposed.
c. Display the output as depicted in Figure 1. Format the values to two decimal points.
Table 1
Tariff Category
Unit
Rates
Sen/kWh
Sen/kWh
For the first 100 (1-100KWH) per month
17.5
For the next 100 (101-200kWh) per month
18.5
For the next 100 (201-300kWh) per month
Sen/kWh
33.0
For the next 200 (301-500kWh) per month
For the next 500 (501-1000kWh) per month
Sen/kWh
44.5
Sen/kWh
45.0
For the next kWh (1001kWh onwards) per month
Sen/kWh
47.0
Month
Usage(kWh)
Consumption(RM)
10% Discount(RM)
6% Tax(RM)
Bill(RM)
Jan
100
17.50
1.75
0.00
15.75
Feb
200
36.00
3.60
0.00
32.40
March
300
69.00
6.90
0.00
62.10
April
2000
849.00
0.00
50.94
899.94
May
Dec
Figure 1
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 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.Similar questions
- SQL 2019 Answer choices (a, b, c, d, and e) indicate whether a certain data type supports the UTF-8 encoding or not.arrow_forwardThe solutions provided didn't work for any of the questions. Please provide different solutions for the 3 questionsarrow_forwardUSING the SELECT statement, query the track table ordered by the bytes. Set the LIMIT to 5 and OFFSET to 5. What is the name of the last row returned? Snowballed Evil Walks Bossa Deixa Entrararrow_forward
- Determine the kind of books in the library's current collection. Each category should include just a single entry.arrow_forwardQuestion 20 Unknown value can be represented in a table as O NULL O Zero O Unknown ΝΑarrow_forwardEnter all of the various kinds of numerical information. In SQLarrow_forward
- Table EMP Column name Column type Integer Up to 10 characters Integer Integer Example entry 7369 Description Employee ID number Employee surname ΕMPNO ENAME SMITH Employee's job title No ID no. of employee's manager Date employment started Monthly salary JOBNO 10 MGR 7566 HIREDATE Date 17/12/1980 SAL Integer 1600 Table JOB Column type Integer Up to 15 Column name Example entry Description job title No Employee's job title JOBNO 10 JOB TITLE SALESMAN characters c) Write SQL statements to define referential integrity constraints on EMP table and give SQL examples to describe the different ways that referential integrity constraints can cause the database system to behave when a user attempts to update a table row. (Maximum 300 words).arrow_forwardDefine the following aggregate functions in an SQL Query. COUNT, MIN, MAX, SUM, AVGarrow_forwardFor questions 4 and 5, use the following order for the rows in your truth tables.P QT TT FF TF FP Q RT T TT T FT F TT F FF T TF T FF F TF F F4. (8 marks) Construct truth tables for the following statement forms.In your truth table, make sure that you include a column for each intermediate expression that you evaluate on your way to your final answer.(a) (P ↔ ¬Q) ∧ (P ↔ Q)(b) (¬P ∨ (¬Q ∨ ¬R)) ∨ (P ∧ Q)arrow_forward
- Rank in order to make it calculate standard deviationarrow_forwardSQL DML/DDL There are five tables describing employees of a company, departments, buildings, which department(s) an employee works in (and a percentage of the time for each), and in which building an employee works (an employee may have more than one office). The primary key of each table is the attribute(s) in capitals and underlined. The foreign keys are in italics. Other attributes are not necessarily unique.Employee (EID, Ename, Salary, Start_Date, End_Date)Building (BID, Bname, Address)Department (DID, Dname, Annual_Budget)In_Department (EID, DID, Percentage_Time)In_Building (EID, BID)Write the SQL statements for the following.1. Find the names of Departments where NO employees work. 2. For employees who are still working in the company, end date has no value (empty). For those who have left the company and have end date values, show their names and the duration of their employment in years. 3. Find the names of buildings where more than 50 employees work. 4. The tables have…arrow_forwardLooking Up Data- INDEX () & MATCH() Which of the following statements describes how the INDEX) and MATCH() functions are combined to lookup data? A) MATCH() is used within the INDEX() function to return the relative position of the data in the lookup table B) INDEX) is used within the MATCH() function to return the relative position of the data in the lookup table C) MATCH() is used to match values from the lookup table and the source table, INDEX() returns the index of these values D) INDEX calculates the relative position of the data in the source table and returns values for MATCH() to lookuparrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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