Questions
language is C++ 1. Design a class that manages a Pet Food Company's quarterly summarized activity....

language is C++

1. Design a class that manages a Pet Food Company's quarterly summarized activity. It should contain the following:

( This is all private data )

Company Name - char[40]   //  This is a static member 
Quarter              - char         // This is a static member.  Validate to be 1-4 in the setter method

Division Name - char[40]

BonusBudgetRate - float   - set to 0.02
Total Sales        - float
Total Expenses - float

1a. Create a public method named netIncome() which will return total sales - total expenses as float.

 

2. Create public class methods (Setters and Getters) that load the data values.

3. Do not create getter/setter methods for the BonusBudgetRate item. It can be set in a constructor or initialized to the default value of 0.02. There is no other reference to it.

4. This class needs a header file and a corresponding cpp file.

5. Create a 'driver' program that contains the main() method and includes the header file for PetFoodCompany class.

   In the driver program, create an instance of the object PetFoodCompany. 
   Internally set the Quarter to 1 and the CompanyName to a name of your choosing.
   Display the CompanyName and Quarter values
   Prompt for total sales and total expenses for this object
   Display the result of netIncome(). 

Below is an example:

 
Company Name is myCompanyName
Current Quarter is 1

Enter Total Sales: 1000

Enter Total Expenses: 600
Net Income = 400

The deliverable is a working program (CPPs & H files) and a UML diagram of the this class.

In: Computer Science

1) What operational and organizational impacts must be considered when transitioning from the planning to the...

1) What operational and organizational impacts must be considered when transitioning from the planning to the implementation phase of your project? What else is impacted? Think about operational activities, resources, responsibilities, and dependencies.

In: Computer Science

What is the difference between infrastructure security and premises security? List and describe three categories of...

  1. What is the difference between infrastructure security and premises security?
  2. List and describe three categories of physical threats caused by humans.
  3. What are the two requirements for physical security?

In: Computer Science

State the differences between hardware and software-based encryption. How Wi-Fi Pineapples work?

  1. State the differences between hardware and software-based encryption.
  2. How Wi-Fi Pineapples work?

In: Computer Science

Why backups are important and what factors an organisation should consider for a backup strategy? List...

  1. Why backups are important and what factors an organisation should consider for a backup strategy?
  2. List and describe different types of backup strategies.
  3. What is the difference between incremental and differential backups?
  4. What is data sovereignty?

In: Computer Science

State the difference between different alternative sites? What do we mean by the term remnant data...

State the difference between different alternative sites?

What do we mean by the term remnant data and how it can compromise security?

What do you understand by the term Redundancy?

In: Computer Science

I have generated a RSA key and saved the private in PEM format after randomly changing...

I have generated a RSA key and saved the private in PEM format after randomly changing 2 consecutive characters inside it (the characters will only apply to p, q, d, n, u). Now I want to write a program that tries to fix the changed PEM file in Python. Any suggestions on how to write my code?

In: Computer Science

In this assignment, you are required to write a Bash script, call it assignment2.sh. Your Bash...

In this assignment, you are required to write a Bash script, call it assignment2.sh. Your Bash script has to accept at least four input arguments, and must:

1) Print to the user a set of instructions explaining how the PATH variable can be used in Bash.

2) Save the manual of the 'awk' command in the file /tmp/help.txt.

3) Shut down your Ubuntu box at 2 o'clock tonight.

4) Store your name and your partner's name in a text file inside your home directory. The name of the file must have the following format: ite404-<date>.txt, where <date> is the current date; e.g. ite404-2020-10-26.txt.

In: Computer Science

Describe the steps involved in converting an entity-relationship diagram to a set of normalised tables.

Describe the steps involved in converting an entity-relationship diagram to a set of normalised tables.

In: Computer Science

Fortran 90: Calculate the center of mass of water, shift origin to the center of mass,...

Fortran 90: Calculate the center of mass of water, shift origin to the center of mass, construct moment of inertia tensor, determine the principal moments of inertia, print the eigenvalues of the inertia tensor.

In: Computer Science

What are the different options for converting a subtype-supertype hierarchy to relational tables?

What are the different options for converting a subtype-supertype hierarchy to relational tables?

In: Computer Science

Explain how the foreign key constraint maintains referential integrity between two tables when the database is...

Explain how the foreign key constraint maintains referential integrity between two tables when the database is inserted, updated, or deleted. What are the different 'referential actions' (foreign key rules) that can be specified?

In: Computer Science

Write a method (in Java) that will return output as stated below: toThePowerOf(int): Applies exponentiation to...

Write a method (in Java) that will return output as stated below:

toThePowerOf(int): Applies exponentiation to the existing PolyTerm. For example, 2.4x^3 to the power of 3 should return 13.824x^9 while 2.4x^3 to the power of -3 should return 0.0723x^-9

Respective JUnit test for this question:

public void testToThePowerOf() {
       assertEquals(1, t1.toThePowerOf(3).coefficient, 0.0001);
       assertEquals(3, t1.toThePowerOf(3).exponent);

       assertEquals(13.824, t2.toThePowerOf(3).coefficient, 0.0001);
       assertEquals(9, t2.toThePowerOf(3).exponent);

       assertEquals(0.0723, t2.toThePowerOf(-3).coefficient, 0.0001);
       assertEquals(-9, t2.toThePowerOf(-3).exponent);

       assertEquals(-0.2962, t3.toThePowerOf(-3).coefficient, 0.0001);
       assertEquals(0, t3.toThePowerOf(-3).exponent);

       assertEquals(46.656, t4.toThePowerOf(3).coefficient, 0.0001);
       assertEquals(-6, t4.toThePowerOf(3).exponent);

       assertEquals(0.0016, t4.toThePowerOf(-5).coefficient, 0.0001);
       assertEquals(10, t4.toThePowerOf(-5).exponent);

       currentMethodName = new Throwable().getStackTrace()[0].getMethodName();
   }

Main Function:

public class PolyTermTest {
   public static int score = 0;
   public static String result = "";
   public static String currentMethodName = null;
   ArrayList methodsPassed = new ArrayList();
  
   PolyTerm t1, t2, t3, t4;

   @BeforeEach
   public void setUp() throws Exception {
       currentMethodName = null;
       t1 = new PolyTerm(1, 1); //x
       t2 = new PolyTerm(2.4, 3); //2.4x^3
       t3 = new PolyTerm(-1.5, 0); //-1.5
       t4 = new PolyTerm(3.6, -2); //3.6x^-2
   }

In: Computer Science

Use Tinkercad or any other tool to implement the following project You have two Arduinos which...

Use Tinkercad or any other tool to implement the following project

You have two Arduinos which are connected using serial cable

Arduino#1 is connected to the following components

1-LCD, , 2-DC motor, 3-Temperature Sensor

Arduino#2 is connected to an Alarm (Buzzer) + LED

You may use other components such as resistors, function generator, power supply, relay, etc.

The system should do the following:

  1. Read the temperature every 1.5 seconds (DO NOT USE DELAY).
  2. Starting at t=6 seconds, calculate the average temperature (Tavg) during the last 6 seconds. Repeat this process every 1.5 seconds (moving average).
  3. Write the Tavg on the LCD.
  4. If the Tavg is larger than 29 ̊C, drive a DC motor (fan) with 20% duty cycle. And then increase the speed of the fan with 10% for every 2 ̊C increase above 29. If the temperature goes below 27 C, turn the DC motor off.
  5. If the Temperature become more than 35 ̊C, then the alarm will work on Arduino#2 and the LED will be ON

In: Computer Science

IN C int count_primes(int start, int end) {   //TODO: return the count of prime numbers in...

IN C

int count_primes(int start, int end)

{

  //TODO: return the count of prime numbers in range [start, end] inclusive.

  return 0;

}

In: Computer Science