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 implementation phase of your project? What else is impacted? Think about operational activities, resources, responsibilities, and dependencies.
In: Computer Science
In: Computer Science
In: Computer Science
In: Computer Science
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 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 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.
In: Computer Science
In: Computer Science
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 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 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 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:
In: Computer Science
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