You have been asked to set-up remote meetings due to the spread COVID-19. Share which remote learning program you will utilize and explain why you selected the option. Your response must consist of a minimum of 15 complete sentences.
In: Operations Management
Describe the difference between making a class a
member of another class (object composition) and making a class a
friend of another class.
Explain why memberwise assignment can cause problems
with a class that contains a pointer member.
Explain why the parameter of a copy constructor must
be a reference.
In: Computer Science
Java- creat a method that takes two char parameters. Return a String containing all characters, in order, from the first char parameter (inclusive) to the last (inclusive). For instance, input('a', 'e'), and return "abcde".
In: Computer Science
In: Computer Science
Generate 5th order linear recursive sequence using shift registers using the primitive polynomial 1+X^2+x^5
In: Computer Science
In Java
An outlet store is having a sale in their Cabin brand sweaters.
There are two different pricing systems depending on if it is a
Cabin brand or not. Tax must be added on after the sweater charge
is computed.
You must have two classes using separate files.
Requirements for Sweater Class
Fields
1. sweater price (in dollars)
2. Boolean to indicate if it is a Cabin brand or not
3. number of sweaters purchased
Methods
1. One 3 parameter constructor- the constructor uses
three parameters representing the sweater price, whether it is a
Cabin Brand or not, and the number of sweaters purchased.
2. Getter and setter for each field
3. getTotalPurchase method
This method must call the appropriate getter member methods where
necessary. Do not access the fields directly.
This method calculates and returns the total amount of the
sweater.
If the sweater is Cabin brand, calculate the discount as
follows;
-If the customer purchases 1 sweater the discount is 20% of the
sweaters price.
-if the customer purchases 2 or more sweaters the discount is
30%
-the customer cannot purchase less than 1 sweater.
-compute the purchase subtotal by subtracting the appropriate
discount from the sweaters price.
Use a tax rate of 7% of the purchase subtotal to compute the sales
tax in dollars. Add the sales tax amount to the purchase subtotal
to determine the total purchase amount.
Return the total purchase amount to the calling code.
Requirements for the SweaterDriver Class
Main method
1. customer must be prompted appropriately
2. All values related to money may include values after
the decimal point. All values displayed to the screen must display
with 2 places after the decimal.
3. The customer must indicate whether the sweater is
Cabin brand or not by typing a single character (y for yes, n for
no) program must accept Upper and lower case, Y,y,N,n.
4. If the sweater is Cabin brand, prompt the customer
to enter the number of Cabin sweaters being purchased.
5. Instantiate a Sweater object using a three parameter
constructor.
Note that the parameter that indicates if the sweater is a Cabin
brand is a Boolean data type.
The customer must type a single character. You will have to use
selection to instantiate a Sweater object with the correct data
type foe this parameter.
6. Display the values in the output by calling the
appropriate method of the Sweater object. The output must line up
at the decimal point as in the sample runs.
Sample runs
1
Enter the price of the sweater: $50.00
Is the swear a Cabin(Y/N)? N
Price of sweater $50.00
Total purchase $53.50
Run 2
Enter the price of the sweater: $60.00
Is the sweater a Cabin(Y/N)? Y
Enter the number of sweaters being purchased: 2
Price of sweater $60.00
Total Purchase $89.88
Run 3
Enter price of sweater: $40.00
Is the sweater a Cabin(Y/N)? Y
Enter the number of sweaters being purchased: 1
Price of sweater $40.00
Total purchase $34.24
In: Computer Science
Project managers are faced with challenges during their management of projects in many different areas. One area may involve contract disputes. What is a best practice that minimizes the probability of a legal challenge when offering contracts for projects?
In: Operations Management
In: Operations Management
Task #1 The while Loop (8 pts) 1. Copy the file DiceSimulation.java as directed by your instructor. Correct syntax errors if any, and improve programming style when necessary (indents, newlines, etc.). DiceSimulation.java is incomplete. Since there is a large part of the program missing, the output will be incorrect if you run DiceSimulation.java. 2. We have declared all the variables. You need to add code to simulate rolling the dice and keeping track of the doubles. Convert the algorithm below into Java code and place it in the main method after the variable declarations, but before the output statements. You will be using several control structures: a while loop and an if-else-if statement nested inside another if statement. Use the indenting of the algorithm to help you decide what is included in the loop, what is included in the if statement, and what isincluded in the nested if-else-if statement. 3. To “roll” the dice, use the nextInt method of the random number generator to generate an integer from 1 to 6. Repeat while the number of dice rolls are less than the number of times the dice should be rolled. Get the value of the first die by “rolling” the first die Get the value of the second die by “rolling” the second die If the value of the first die is the same as the value of the second die If value of first die is 1 Increment the number of times snake eyes were rolled Else if value of the first die is 2 Increment the number of times twos were rolled Else if value of the first die is 3 Increment the number of times threes were rolled Else if value of the first die is 4 Increment the number of times fours were rolled Else if value of the first die is 5 Increment the number of times fives were rolled Else if value of the first die is 6 Increment the number of times sixes were rolled Page 3 of 3 Increment the number of times the dice were rolled 4. Compile and run. You should get numbers that are somewhat close to 278 for each of the different pairs of doubles. Run it several times. You should get different results than the first time, but again it should be somewhat close to 278. Task #2 Using Other Types of Loops: do-while (4 pts) 1. Change the while loop to a do-while loop. 2. Make other necessary changes to save your work as new file named DiceSimulation_Do.java. 3. Compile and run. You should get the same results as at Task #1. Task #3 Using Other Types of Loops: for (4 pts) 1. Change the do-while loop to a for loop. 2. Make other necessary changes to save your work as new file named DiceSimulation_For.java. 3. Compile and run. You should get the same results as at Task #1.
import java.util.Random; // Needed for the Random class
/**
This class simulates rolling a pair of dice 10,000 times
and counts the number of times doubles of are rolled for
each different pair of doubles.
*/
public class DiceSimulation
{
public static void main(String[] args)
{
final int NUMBER = 10000; // Number of dice rolls
// A random number generator used in
// simulating the rolling of dice
Random generator = new Random();
int die1Value; // Value of the first die
int die2Value; // Value of the second die
int count = 0; // Total number of dice rolls
int snakeEyes = 0; // Number of snake eyes rolls
int twos = 0; // Number of double two rolls
int threes = 0; // Number of double three rolls
int fours = 0; // Number of double four rolls
int fives = 0; // Number of double five rolls
int sixes = 0; // Number of double six rolls
// TASK #1 Enter your code for the algorithm here
// Display the results
System.out.println ("You rolled snake eyes " +
snakeEyes + " out of " +
count + " rolls.");
System.out.println ("You rolled double twos " +
twos + " out of " + count +
" rolls.");
System.out.println ("You rolled double threes " +
threes + " out of " + count +
" rolls.");
System.out.println ("You rolled double fours " +
fours + " out of " + count +
" rolls.");
System.out.println ("You rolled double fives " +
fives + " out of " + count +
" rolls.");
System.out.println ("You rolled double sixes " +
sixes + " out of " + count +
" rolls.");
}
}In: Computer Science
In: Computer Science
in your own words explain
What changes are occurring in the arts and literature from the late Medieval period to the early Renaissance?
In: Psychology
What are some risks of a Queens corporation managing global supply chain? Provide example of political Risk and Currency Risk?
In: Operations Management
What are the consequences of avoiding all conflict? What role do perceptions play in creating conflict? Are most conflicts about facts or about underlying feelings? Is compromise the same as collaboration? How can a supervisor best remain nonjudgmental, supportive, problem-oriented, and sensitive to everyone's needs in the face of conflict?
In: Operations Management
In 1-2 pages (a paragraph or so for each item), describe your top 3 security-related takeaways or security insights you noted while reading the book.(cuckoos egg.)
In: Computer Science
In: Biology