Questions
This is my last assignment in a programming class I had to take as a prerequisite...

This is my last assignment in a programming class I had to take as a prerequisite for a database course (seems odd). The instructor has been awful and I haven't learned much of anything. I use VBA at work and just can't follow C++. I'm stuck on this assignment and have no idea what I'm doing. I'm a database guy at work, I'm not a programmer. Please help.

In C++, a program that performs the following tasks:

1.      Design a Book class that has three data members:

string title

int   pages

double price

2.      Add constructors and methods (as well as method parameters when necessary):

Book()         // constructor(s)

getBookInfo()   // print title, pages, price

setPrice()     // change price

3.      In the main() function, create two Book objects:

b1("C++ Programming", 834, 93.53)

b2("Data Structures", 217, 64.42)

4.      Change the price of b2 to 55.46 using the setPrice() method.

5.     Using cout, Print out book information using the getBookInfo() method as shown below:

C++ Programming 834 93.53

Data Structures 217 55.46

IN C++, a program that performs the following tasks:

1.      Derive a TextBook class (child) from the Book class (parent).

2.      Add new data members:

string school

double discount

3.      Add new constructors and methods (as well as method parameters when necessary):

TextBook()           // constructor(s)

compTextBookPrice()  // price = price - discount

4.      Override inherited methods:

getBookInfo()        // print title, pages, price, school, discount

5.      In the main() function, create two Book objects and two TextBook objects:

b1("C++ Programming", 834, 93.53)

b2("Data Structures", 217, 64.42)

tb1("Database", 365, 74.41, "YSU", 20.00)

tb2("Networks", 522, 92.58, "YSU", 20.00)

6.      Using cout, print out book information as shown below:

C++ Programming  834  93.53

Data Structures  217  64.42

Database         365  54.41 YSU 20.00

Networks         522  72.58 YSU 20.00

In: Computer Science

4.4-4.6 The term arithmetic overflow refers to the condition where the result of some computation is...

4.4-4.6 The term arithmetic overflow refers to the condition where the result of some computation is
outside the range of expected results. When a computation produces a result with absolute value
smaller then the computer can represent we have arithmetic underflow.
Answer the following 4 point questions regarding the detection of incorrect computations when processing ALU instructions.


4.4 We have explored the potential for incorrect answers caused by overflow when the ALU operates
on integers. For completeness, we need to examine the possibility of underflow in integer ALU
operations. Either give an example of underflow or explain why underflow is impossible for
integer ALU computations.

4.5 Can floating point arithmetic using the IEEE standard format result in overflow? Either explain
why overflow is impossible for floating point or explain how the presence of overflow can be
detected. Note: an example can be used when giving your answer, but an example without
explanation is too poor to afford full credit.

4.6 Can floating point arithmetic using the IEEE standard format result in underflow? Either explain
why underflow is impossible for floating point computations or explain how the presence of underflow can be detected. Give an example with an explanation.

In: Computer Science

1. a) Write a C program to calculate |A-B|. You should type in A and B...

1.

a) Write a C program to calculate |A-B|. You should type in A and B when running the program.

b) Write a C program using a function to calculate (A-B)^(1/2)

-If A > B, the result will be (A-B)^(1/2)

-If A < B,the result will be (B-A)^(1/2)i

-You should type in A and B when running the program.

In: Computer Science

Explain the Starving Time at Jamestown in the winter of 1609-1610

Explain the Starving Time at Jamestown in the winter of 1609-1610

In: Operations Management

Peterson algorithm operating systems can someone explain to me what will be shared between the two...

Peterson algorithm operating systems can someone explain to me what will be shared between the two processes? and how is the order of execution in the two processes? if possible by drawing it will be better

i am mainly confused on how the order of execution between the two processes will be and how will the data be shared between them. i am also confused how the program counter will work between them

In: Computer Science

What is collective bargaining? What is an exception to the WARN (Worker Adjustment and Retraining Act)?

What is collective bargaining?

What is an exception to the WARN (Worker Adjustment and Retraining Act)?

In: Operations Management

Put the following molecules in order from lowest to highest overall net dipole moment and explain...

Put the following molecules in order from lowest to highest overall net dipole moment and explain why.
a. NH3
b. HCl
c. HF
d. CCl4

In: Chemistry

Please refer on the article titled as “Improving Occupational Safety and Health in Construction”, published in...

Please refer on the article titled as “Improving Occupational Safety and Health in Construction”, published in The Ingenieur, Vol. 69 January – March 2017 by the Board of Engineers Malaysia. simplify and create a summary of the article. (150words)

In: Mechanical Engineering

What is the sociological imagination and how is it related to agency and social structure?

What is the sociological imagination and how is it related to agency and social structure?

In: Psychology

Research and discuss 1 public health issue in the United States today. Explain why it is...

Research and discuss 1 public health issue in the United States today.

Explain why it is a public health issue and what is currently being done to address it at the local, state, and federal levels.
Discuss any applicable health policies and regulations that may be in place to address the issue.

In: Operations Management

PLEASE USE SOMETHING THAT HAS NOT BEEN USED BEFORE AND EXAMPLES PLEASE! Discuss a population group...

PLEASE USE SOMETHING THAT HAS NOT BEEN USED BEFORE AND EXAMPLES PLEASE!

Discuss a population group that is facing greater challenges and barriers to accessing care in the United States. Include the following in your discussion:

  • Why does that segment of the U.S. population face greater challenges and barriers to accessing care?
  • What programs (local, state, or federal), if any, exist today to attempt to provide access to the vulnerable population you are discussing?

In: Operations Management

PLEASE USE SOMETHING THAT HAS NOT BEEN USED BEFORE AND EXAMPLES PLEASE! Discuss a population group...

PLEASE USE SOMETHING THAT HAS NOT BEEN USED BEFORE AND EXAMPLES PLEASE!

Discuss a population group that is facing greater challenges and barriers to accessing care in the United States. Include the following in your discussion:

  • Why does that segment of the U.S. population face greater challenges and barriers to accessing care?
  • What programs (local, state, or federal), if any, exist today to attempt to provide access to the vulnerable population you are discussing?

In: Operations Management

Choose Amazon to analyze High level risk management assessment, Identify 3 Traditional hazard risks, Identify 3...

Choose Amazon to analyze

High level risk management assessment, Identify 3 Traditional hazard risks, Identify 3 ERM type risks, and discuss the risks and evaluate potential costs of these risks

In: Operations Management

JAVA coding language: Consider the method getAllCharAsString: public statis String getAllCharAsString(String inputStr, char target) { }...

JAVA coding language:

Consider the method getAllCharAsString:

public statis String getAllCharAsString(String inputStr, char target) {

}

The method accepts a String parameter, inputStr, and a char parameter, target. It returns the result string consisting of all the characters in inputStr which match the target character (matching is case sensitive, for example, 'c' does not match "C"). If the characters match, the character is appended to the result String. After all the characters in inputStr have been compared, the method returns the result String. The method returns the empty String if there were no matches. Assume the inputStr is a String with length >= 0.

Example 1:

String str = "Open the pod bay doors Hal.";

String resStr = getAllCharsAsString(str, 'o');

resStr would be the String, "ooo".

Example 2:

String str = "Open the pod bay doors Hal.";

String resStr = getAllCharsAsString(str, 'z');

resStr would be the empty String, " ".

Write the getAllCharAsString method body in the box below.

In: Computer Science

c++ programing. Objectives Further practice with classes Use of inheritance Use compositions Define a class called...

c++ programing.

Objectives

  • Further practice with classes
  • Use of inheritance
  • Use compositions

Define a class called Person with private members name of type string, and money of integer type. The class has the public member functions set(), getMoney(), print(), and a parameterized constructor with default values.

Define a class called Patient with private data members name of type string, durationOfTreatment, and TreatmentCost of type integer. The class has the public member functions set(), getCost(), getDuration(), print(), and a parameterized constructor with default values.

Define a class called Doctor that publicly inherits the class Person and has the private members numberOfPatients,totalCost, list[] (an array of type Patient), and calculateTotalCost(). The class has the public member functions set(), print(), and a parameterized constructor with default values.

Implement all member functions, enforcing the principle of least privileged.

The following driver produces the given sample input / output.

int main()

{

            Doctor Hakeem;

            Hakeem.set("Ali Omar", 3000, 3);

            Hakeem.print();

            return 0;

}

Sample input / output:

Enter the name, duration, and cost of treatment number 1: Allergies 23 150

Enter the name, duration, and cost of treatment number 2: Bronchiectasis 15 280

Enter the name, duration, and cost of treatment number 3: Gallstones 10 50

Ali Omar has 3000 dirham and treated the following patients:

        Allergies was treated for 23 minutes, at a cost 150 dirham per minute

        Bronchiectasis was treated for 15 minutes, at a cost 280 dirham per minute

        Gallstones was treated for 10 minutes, at a cost 50 dirham per minute

The total cost of the 3 patients is 8150 dirham

The overall total of money is 11150 dirham

In: Computer Science