1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ella [17]
3 years ago
10

Your task is to create a program that computes the total cost of reserving one or more hotel rooms for a specified number of day

s. An off-season room is $50.00 per night, and during the on-season it is $100.00 per night. When a group reserves 6 rooms or more they get a discount of 10% on the reservation cost. Some states have a sales tax which is a fraction of the discounted reservation cost. The total cost will be computed as the sum of the discounted reservation cost plus taxes. Note: it will count against you if you tax them on the reservation cost before any discounts are applied!
Computers and Technology
1 answer:
aniked [119]3 years ago
7 0

Answer:

C++.

Explanation:

int main() {

   int off_cost = 50;

   int on_cost = 100;

   float discount = 0.1;

   string season = "off season";

///////////////////////////////////////////////////////////////////////////

   int no_of_rooms = 0;

   cout<<"How many rooms? ";

   cin>>no_of_rooms;

   cout<<endl;

///////////////////////////////////////////////////////////////////////////

   float total_cost = 0;

   if (season == "off season") {

       if (no_of_rooms > 5) {

           total_cost = (no_of_rooms * off_cost) - ((no_of_rooms * off_cost) * discount);

           // With tax

           // total_cost = total_cost + (total_cost * <em>fraction</em>);

       }

       else

           total_cost = (no_of_rooms * off_cost);

   }

///////////////////////////////////////////////////////////

   else {

       if (no_of_rooms > 5) {

           total_cost = (no_of_rooms * on_cost) - ((no_of_rooms * on_cost) * discount);

           // With tax

           // total_cost = total_cost + (total_cost * <em>fraction</em>);

       }

       else

           total_cost = (no_of_rooms * on_cost);

   }

///////////////////////////////////////////////////////////////////////////

   cout<<"Total cost = "<<total_cost;

   return 0;

}

You might be interested in
Design a class named Employee. The class should keep the following information in member variables:
Paha777 [63]

Answer:

Here is the code.

Explanation:

#include <iostream>

#include <cstdlib>

#include <string>

#include <iomanip>

using namespace std;

class Employee

{

private:

string employeeName;

int employeeNumber;

int hireDate;

public:

void setemployeeName(string employeeName);

void setemployeeNumber(int);

void sethireDate(int);

string getemployeeName() const;

int getemployeeNumber() const;

int gethireDate() const;

Employee();

};

void Employee::setemployeeName(string employeeName)

{

employeeName = employeeName;

}

void Employee::setemployeeNumber(int b)

{

employeeNumber = b;

}

void Employee::sethireDate(int d)

{

hireDate = d;

}

string Employee::getemployeeName() const

{

return employeeName;

}

int Employee::getemployeeNumber() const

{

return employeeNumber;

}

int Employee::gethireDate() const

{

return hireDate;

}

Employee::Employee()

{

cout << "Please answer some questions about your employees, ";

}

class ProductionWorker :public Employee

{

private:

int Shift;

double hourlyPay;

public:

void setShift(int);

void sethourlyPay(double);

int getShift() const;

double gethourlyPay() const;

ProductionWorker();

};

void ProductionWorker::setShift(int s)

{

Shift = s;

}

void ProductionWorker::sethourlyPay(double p)

{

hourlyPay = p;

}

int ProductionWorker::getShift() const

{

return Shift;

}

double ProductionWorker::gethourlyPay() const

{

return hourlyPay;

}

ProductionWorker::ProductionWorker()

{

cout << "Your responses will be displayed after all data has been received. "<<endl;

}

int main()

{

ProductionWorker info;

string name;

int num;

int date;

int shift;

double pay;

cout << "Please enter employee name: ";

cin >> name;

cout << "Please enter employee number: ";

cin >> num;

cout << "Please enter employee hire date using the format \n";

cout << "2 digit month, 2 digit day, 4 digit year as one number: \n";

cout << "(Example August 12 1981 = 08121981)";

cin >> date;

cout << "Which shift does the employee work: \n";

cout << "Enter 1, 2, or 3";

cin >> shift;

cout << "Please enter the employee's rate of pay: ";

cin >> pay;

info.setemployeeName(name);

info.setemployeeNumber(num);

info.sethireDate(date);

info.setShift(shift);

info.sethourlyPay(pay);

cout << "The data you entered for this employee is as follows: \n";

cout << "Name: " << info.getemployeeName() << endl;

cout << "Number: " << info.getemployeeNumber() << endl;

cout << "Hire Date: " << info.gethireDate() << endl;

cout << "Shift: " << info.getShift() << endl;

cout << setprecision(2) << fixed;

cout << "Pay Rate: " << info.gethourlyPay() << endl;

system("pause");

return 0;

}

7 0
3 years ago
I have a question, but it's not a math question. Can anyone give me 5 unblockers for school computers? If you answer this, you w
ValentinkaMS [17]

Answer:

I mean if your talking about games then just try Cool math I will give link in comments

Explanation:

4 0
2 years ago
Read 2 more answers
A _____ software system determines the steps needed to produce components and instructs the machines that do the work.
konstantin123 [22]

Answer:

A computer-aided manufacturing or (cam) software system

Explanation:

Hope I could help :)

8 0
3 years ago
When light does not pass through or bounce off an object, it is said to be
Dmitry [639]
The object is said to be absorbed
3 0
3 years ago
Read 2 more answers
When is the redo log buffer written to the redo log file?
natka813 [3]

Answer: B)The redo log buffer becomes one-third full.

Explanation:Redo log buffer is the type of buffer file that is present for storing the changes that have been done in data. Database changes are the made goes in the records of the redo entries.the change of the buffer to the redo files is done when the buffer contains change records which are full till the one-third section, thus conversion takes place from the redo buffer to the redo files.

5 0
3 years ago
Other questions:
  • Zara is designing a slide with a numbered label on a picture. She wants the number to appear when the she presses a button on th
    11·2 answers
  • Which of the following is NOT a good idea to do after you change the root password?
    12·1 answer
  • Whats your favorite sport between these options?
    12·2 answers
  • Why do people still use Intel HD graphics for gaming?
    8·1 answer
  • Write a C function named apply_all that expects two arrays of integers and their sizes and dynamically allocates a new array of
    7·1 answer
  • Temperature converter. This program should prompt the user for two arguments, first a decimal number and second, a single letter
    10·1 answer
  • When preparing a technical document, do all of the following EXCEPT:_______.
    12·1 answer
  • Who invented computer ?​
    9·2 answers
  • Simple Java programming
    15·2 answers
  • a web server will utilize a directory protocol to enable users to authenticate with domain credentials. a certificate will be is
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!