C++
Download Lab10.cpp . In this file, the definition of the class personType has given. Think of the personType as the base class.
Lab10.cpp is provided below:
#include <iostream>
#include <string>
using namespace std;
// Base class personType
class personType
{
public:
void print()const;
//Function to output the first name and last name
//in the form firstName lastName.
void setName(string first, string last);
string getFirstName()const;
string getLastName()const;
personType(string first = "", string last = "");
//Constructor
//Sets firstName and lastName according to the parameters.
//The default values of the parameters are null strings.
//Postcondition: firstName = first; lastName = last
private:
string firstName; //variable to store the first name
string lastName; //variable to store the last name
};
void personType::print() const
{
cout << "Person FirstName="<<firstName << "
LastName=" << lastName<< endl;
}
void personType::setName(string first, string last)
{
firstName = first;
lastName = last;
}
string personType::getFirstName() const
{
return firstName;
}
string personType::getLastName() const
{
return lastName;
}
//constructor
personType::personType(string first, string last)
{
firstName = first;
lastName = last;
}
// --------------------Start your code from here
//--------------------driver program
int main()
{
personType person1("Lisa", "Regan");
doctorType doctor1("Sarah", "Conner", "Dentist");
patientType patient1("Sam", "Fire",200,100,1916);
billType b1;
b1.setDoctor(doctor1);
b1.setPatient(patient1);
b1.setCharge(250.66);
cout << "<personType> Printing...\n";
person1.print();
cout << endl;
cout << "<doctorType> Printing...\n";
doctor1.print();
cout << endl;
cout << "<patientType> Printing...\n";
patient1.print();
cout << endl;
cout << "<billType> Printing...\n";
b1.print();
cout << endl;
return 0;
}
Question:
● Derive the class doctorType, inherited from the class
personType, with an additional class member variable member to
store a doctor’s specialty(string type) Then, implement following
class member function prototypes.
doctorType(string,string,string);//Firstname Lastname
Specialty
doctorType();//Default constructor
void setSpecialty(string);//Set doctor specialty
string getSpecialty()const;// Get doctor specialty
void print()const;//Display doctor information the same as given
output format
● Derive the class patientType, inherited from the class
personType, with additional class
member variables to store a patient’s id , age , and dob (Date of
birth)(All are integer ).
Then, implement following class member function prototypes.
patientType(string, string, int, int, int);//Firstname Lastname id
age dob
patientType();Default constructor
void setId(int);//Set patient id
void setage(int);//Set patient age
void setDob(int);//Set patient DOB
int getId()const;//Get patient id
int getage()const;//Get patient
int getDob()const;//Get patient DOB
void print()const; //Display patient information the same as given
output format
● Design a class billType, with class member variables to store
a patient’s information
( patientType ), the patient’s doctor’s information ( doctorType ),
and the hospital
charges( double ). Then, implement following class member function
prototypes.
billType(doctorType &, patientType &); // Constructor
void setCharge(double);//Set hospital charges
double getCharge()const;//Get hospital charges
void print()const;//Display a bill information the same as given
output format
Use the provided driver program to test your program. You should get the same output
Output:
<perspnType> Printing...
Person FirstName=Lisa LastName=Regan
<doctorType> Printing...
Doctor FirstName=Sarah LastName=Conner Specialty=Dentist
<patientType> Printing...
Patient FirstName=Sam LastName=Fire Id=200 Age=100 DOB=1916
<billType> Printing..
Patient FirstName=Sam LastName=Fire Id=200 Age=100 DOB=1916
Patient's doctor FirstName=Sarah LastName=Conner Specialty=Dentist
Hospital charge=250.66$
Press any key to continue...
In: Computer Science
Suppose that the market demand for organic specialty rose hip jelly is given by:
? = 500 − 5?
There are only two firms, A and B, producing this product, each at a constant marginal and average total cost of $50.
Find the following for both firms under a Stackelberg market structure with A being the first mover (B reacts to A since A moves first).
A.) A’s Quantity [7]
B.) B’s Quantity [7]
C.) Industry Quantity [5]
D.) Price (this jelly is expensive! That must be a case of 20….) [7]
E.) A’s Profit [5]
F. ) B’s Profit [5]
G.) Industry Profit [5]
H. ) Order expected industry profits from greatest to least: [8]
a. Cournot
b. Collusive Monopoly
c. Bertrand
I. ) Questions regarding Bertrand market structure: [6]
a. What type of market structure does Bertrand resemble? This is in slides.
Hint: it probably the first market structure we talked about.
b. How much are profits under Bertrand?
c. What are firms choosing under Bertrand Market structure (Q or P)? How does this result in incentives that lead to the answer to part b?
In: Economics
National Orthopedics Co. issued 8% bonds, dated January 1, with a face amount of $600,000 on January 1, 2016. The bonds mature on December 31, 2019 (4 years). For bonds of similar risk and maturity the market yield was 12%. Interest is paid semiannually on June 30 and December 31. (FV of $1, PV of $1, FVA of $1, PVA of $1, FVAD of $1 and PVAD of $1) (Use appropriate factor(s) from the tables provided.) Required: 1. Determine the price of the bonds at January 1, 2016. 2. Prepare the journal entry to record their issuance by National on January 1, 2016. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field.) 3. Prepare an amortization schedule that determines interest at the effective rate each period. 4. Prepare the journal entry to record interest on June 30, 2016. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field.) 5. Prepare the appropriate journal entries at maturity on December 31, 2019. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field.)
In: Accounting
Fit & Slim (F&S) is a health club that offers members
various gym services.
Required:
1. Assume F&S offers a deal whereby enrolling
in a new membership for $700 provides a year of unlimited access to
facilities and also entitles the member to receive a voucher
redeemable for 25% off yoga classes for one year. The yoga classes
are offered to gym members as well as to the general public. A new
membership normally sells for $720, and a one-year enrollment in
yoga classes sells for an additional $500. F&S estimates that
approximately 40% of the vouchers will be redeemed. F&S offers
a 10% discount on all one-year enrollments in classes as part of
its normal promotion strategy.
1. a. & b. Indicate below whether each item is
a separate performance obligation. For each separate performance
obligation you have indicated, allocate a portion of the contract
price.
c. Prepare the journal entry to recognize revenue
for the sale of a new membership.
2. Assume F&S offers a “Fit 50”
coupon book with 50 prepaid visits over the next year. F&S has
learned that Fit 50 purchasers make an average of 40 visits before
the coupon book expires. A customer purchases a Fit 50 book by
paying $500 in advance, and for any additional visits over 50
during the year after the book is purchased, the customer can pay a
$15 visitation fee per visit. F&S typically charges $15 to
nonmembers who use the facilities for a single day.
a. & b. Indicate below whether each item is a
separate performance obligation. For each separate performance
obligation you have indicated, allocate a portion of the contract
price.
c. Prepare the journal entry to recognize revenue
for the sale of a new Fit 50 book.
Indicate below whether each item is a separate performance obligation. For each separate performance obligation you have indicated, allocate a portion of the contract price.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
Prepare the journal entry to recognize revenue for the sale of a new membership. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field.)
| No | Transaction | General Journal | Debit | Credit |
|---|---|---|---|---|
| 1 | 1 | Cash | 700 | |
| 672 | ||||
|
28 |
Indicate below whether each item is a separate performance obligation. For each separate performance obligation you have indicated, allocate a portion of the contract price.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
Prepare the journal entry to recognize revenue for the sale of a new Fit 50 book. (If no entry is required for a transaction/event, select "No journal entry required" in the first account field.)
| No | Transaction | General Journal | Debit | Credit |
|---|---|---|---|---|
| 1 | 1 | Cash | 500 | |
|
500 |
In: Accounting
The table below shows aggregate demand and aggregate supply schedules in a hypothetical economy, Acadia.
| Aggregate Demand and Aggregate Supply Schedules for Acadia | ||||
| Real GDP | ||||
| (AD0) | (AD1) | (AS0) | (AS1) | |
| Price Level (2012 = 100) | (2012 $ billions) | |||
| 125 | 180 | 205 | 220 | 245 |
| 120 | 190 | 215 | 215 | 240 |
| 115 | 200 | 225 | 200 | 225 |
| 110 | 210 | 235 | 185 | 210 |
| 105 | 220 | 245 | 165 | 190 |
a. Draw a graph showing Acadia's AD0, AD1,
AS0 and AS1. Using the tools given below plot
only the endpoints of the demand curves AD0 and
AD1. Plot all 5 points for each supply curve,
AS0 and AS1.
b. Initially AD0 and AS0 are the relevant
schedules.
The equilibrium price level is and
equilibrium real output is $ billion.
If the price level is 125 then real output is
$ billion, real expenditures are $ billion,
and there is an unintended (Click to
select) decrease increase in
inventories. This pushes the price level (Click to
select) down up .
If the price level is 110 then real output is
$ billion, real expenditures are $ billion,
and there is an unintended (Click to
select) decrease increase in
inventories. This pushes the price level (Click to
select) down up .
c. Now aggregate demand shifts from AD0 to
AD1 while aggregate supply remains at
AS0.
Aggregate demand has undergone
a(n) (Click to
select) decrease increase . As a
result the equilibrium price level (Click to
select) decreases stays the
same increases and has a value
of while equilibrium real output (Click to
select) decreases stays the
same increases and has a value of
$ billion.
d. Now aggregate supply shifts from AS0 to
AS1, while aggregate demand remains at
AD0.
Aggregate supply has undergone
a (Click to select) short-run
decrease short-run increase long-run
decrease long-run increase . As a result the
equilibrium price level (Click to
select) decreases stays the
same increases and has a value
of while equilibrium real output (Click to
select) decreases stays the
same increases and has a value of
$ billion.
In: Economics
In: Finance
In: Finance
Materials Variances
Manzana Company produces apple juice sold in gallons. Recently, the company adopted the following material standard for one gallon of its apple juice:
Direct materials 128 oz. @ $0.04 = $5.12
During the first week of operation, the company experienced the following results:
Required:
Note: Enter favorable values as negative numbers. Enter unfavorable values as positive numbers.
1. Compute the materials price variance.
$ Unfavorable
2. Compute the materials usage variance.
$ Unfavorable
3. During the second week, the materials usage
variance was $4,000 unfavorable and the materials price variance
was $21,000 unfavorable. The company purchased and used 2,420,000
ounces of material during this week. How many gallons of juice were
produced? If required, round your answer to nearest whole
value.
gallons
What was the actual price paid per ounce of materials? Round
your answer to the nearest cent.
$ per ounce
In: Accounting
You are now ready to play the part of the manager of the public transit system. Your finance officer has just advised you that the system faces a deficit. Your board does not want you to cut service, which means that you cannot cut costs. Your only hope is to increase revenue. Would a fare increase boost revenue? You consult the economist on your staff who has researched studies on public transportation elasticities. She reports that the estimated price elasticity of demand for the first few months after a price change is about −0.3, but that after several years, it will be about −1.5. Explain why the estimated values for price elasticity of demand differ. Compute what will happen to ridership and revenue over the next few months if you decide to raise fares by 5%. Compute what will happen to ridership and revenue over the next few years if you decide to raise fares by 5%. What happens to total revenue now and after several years if you choose to raise fares?
In: Economics
HSA, a local hospital system has set up a new vaccination facility for a virus that is causing serious illness in the region.
The total cost for the set up is $300,000. The hospital system services patients with all types of insurance. They would like to make $10,000 extra income at the end of the year. In terms of the number of patients, they have Medicare (30%), and Medicaid (25%), Managed Care Type I (5%), Managed Care type II (35%), and Uninsured (5%).
The first three categories have fixed payment rates, for Medicare $180, Medicaid $170, and Managed care Type I $225. The other two pay based on the hospital charges (or prices). Managed Care Type 2 pays 80% of the charges and the Uninsured pay on an average 10% of the charges.
The expected annual volume is 2000.
In: Accounting