Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Make sure follow the instruction: A resort on the island of St. Maarten want you to program to keep track of the one bedroom suites

Make sure follow the instruction:

A resort on the island of St. Maarten want you to program to keep track

of the one bedroom suites they rent. The price of the suite depends on whether

the living room has an ocean view or a garden view, The suite with a garden

view costs $350.00 a week. The suite with the ocean view costs $450.00 a week.

There is a 10% resort/utility tax added to the cost of either suite. In other words a

garden view suite costs $350.00 + tax and an ocean view suite costs $450.00 plus tax.

Use a #define gardenView 350.00

#define oceanView 450.00

#define tax 0.10

A C++ program has been provided for you with values for the variables hard

coded into the program

resortName = "Oyster Bay Beach Resort";

resortDate = "December 17, 2020";

numOcean = 32;

numGarden = 47;

numRented = numGarden + numOcean;

This program is solely concerened with formatting the output correctly using

The C++ std manipulators

The output should look like the sample below.

Look at the text document included with the assignment and you can figure out the exact spacing of the report

Extra credit - center the resort name and date. Remember that the resort name and date can be of various lengths

Oyster Bay Beach Resort

6/22/2018

one number cost weekly

bedroom suits rented per unit income tax ----total----

ocean view 35 450.00 $ 15750.00 $ 1575.00 $ 17325.00

garden view 65 350.00 $ 22750.00 $ 2275.00 $ 25025.00

total units 100 $ 38500.00 $ 3850.00 $ 42350.00

This is the code:

/******************************************

* library includes

******************************************/

#include // needed for I/O

#include

#include // for string class

/******************************************

* pre-processor

******************************************/

#define costGarden 350.00

#define costOcean 450.00

#define tax 0.10

using namespace std;

/****************************************

* non-member function prototypes

****************************************/

/*****************************************

* main() - the function that executes

*****************************************/

int main()

{

string resortName; //hold the resort name

string resortDate; //hold report date

int numGarden = 0; //number of garden view suits rented

int numOcean = 0; //number of ocean view suits rented

int numRented = 0; //total units rented

float oCostWeekly = 0; //cost of all garden units for a week

float oCostTax = 0; //cost weekly tax

float oCostTotal = 0; //total weekly cost

float gCostWeekly = 0; //cost of all ocean units for a week

float gCostTax = 0; //cost weekly tax

float gCostTotal = 0; //total weekly cost

float tCostWeekly = 0; //cost of all units for a week

float tCostTax = 0; //cost weekly tax

float tCostTotal = 0; //total weekly cost

int w = 0;

/****************************************

* initialize variables

****************************************/

resortName = "Oyster Bay Beach Resort";

resortDate = "December 17, 2020";

numOcean = 32;

numGarden = 47;

numRented = numGarden + numOcean;

/****************************************

* calculate

****************************************/

oCostWeekly = numOcean * costOcean;

gCostWeekly = numGarden * costGarden;

tCostWeekly = gCostWeekly + oCostWeekly;

oCostTax = oCostWeekly * tax;

gCostTax = gCostWeekly * tax;

tCostTax = oCostTax + gCostTax;

oCostTotal = oCostWeekly + oCostTax;

gCostTotal = gCostWeekly + gCostTax;

tCostTotal = oCostTotal + oCostTotal;

/****************************************

* output

****************************************/

system("PAUSE"); // causes the program to pause

return 0;

} // end main

Do not use other code. to solve this program use this code.

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

b. Where did they come from?

Answered: 1 week ago

Question

b. Will new members be welcomed?

Answered: 1 week ago