Write a C++ program.
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
Write a C++ program.
![Write a complete program based on the following requirements:
Use the following structure.
struct Rental
{
char name [20];
float rent;
int month;
} ;
Declare and define function report..):
Parameter
: array R of struct Rental [size 3]
Function prototype given : float report(struct Rental[]);
Using a for loop, display on the screen the records of tenants that has rental due more
than $1000. Also calculate the total amount due for these tenants. [Note: refer to
sample output screen]
Return the total amount due.
In main( ),
Declare an array R of struct Rental. Array size is 3. You may use the code below that has
hardcoded values for it.
struct Rental R[3] = {{"Megan", 300, 4},{"Johnson", 250, 1},{"David", 790, 2}};
Call function report(..):
Parameter : array R of struct Rental.
The function will return the grand total.
Display the grand total amount that is due.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ffba89e3b-e1cf-4080-b69c-16539c4e83d6%2Faf5e34c7-611c-4c2f-b6c6-9913e4d92130%2Fb7gb9ad_processed.png&w=3840&q=75)
Transcribed Image Text:Write a complete program based on the following requirements:
Use the following structure.
struct Rental
{
char name [20];
float rent;
int month;
} ;
Declare and define function report..):
Parameter
: array R of struct Rental [size 3]
Function prototype given : float report(struct Rental[]);
Using a for loop, display on the screen the records of tenants that has rental due more
than $1000. Also calculate the total amount due for these tenants. [Note: refer to
sample output screen]
Return the total amount due.
In main( ),
Declare an array R of struct Rental. Array size is 3. You may use the code below that has
hardcoded values for it.
struct Rental R[3] = {{"Megan", 300, 4},{"Johnson", 250, 1},{"David", 790, 2}};
Call function report(..):
Parameter : array R of struct Rental.
The function will return the grand total.
Display the grand total amount that is due.

Transcribed Image Text:Sample Output Screen
AMOUNT DUE MORE THAN $1000.00
Tenant name : Megan
Monthly rental : $ 300.00
Unpaid months :$ 4
Unpaid amount :$ 1200.00
Tenant name : David
Monthly rental : $ 790.00
Unpaid months :$ 2
Unpaid amount : $ 1580.00
Total rental to be collected : $ 2780.00
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 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