Questions
CODE IN JAVA: Write a ProductTester class that creates one Product object named "Juicer" with a...

CODE IN JAVA:

Write a ProductTester class that creates one Product object named "Juicer" with a price of $50.99, prints the name and price of the product, reduces its price by 4.0, and then prints its price again.

public class Product {

private String name;

private double price;

public Product(String productName, double productPrice) {

name = productName;

price = productPrice;

}

public String getName() {

return name;

}

public double getPrice()

{

return price;

}

public void reducePrice(double amount) {

price = price - amount;

}

}

}

In: Computer Science

Please code C# 10. Write a program that allows a user to input names and corresponding...

Please code C#

10.

  1. Write a program that allows a user to input names and corresponding heights (assumed to be in inches). The user can enter an indefinite number of names and heights. After each entry, prompt the user whether they want to continue. If the user enters true, ask for the next name and height. If the user enters false, display the name of the tallest individual and their height.

Sample run:

Name?”

James

“Height?”

50

“Continue?”

True

Name?”

Sarah

“Height?”

60

“Continue?”

False

“Sarah is the tallest at 60 inches”

In: Computer Science

[JAVA SCRIPT] Please create an array of student names and another array of student grades. Create...

[JAVA SCRIPT]

Please create an array of student names and another array of student grades.

Create a function that can put a name and a grade to the arrays.

Keep Read student name and grade until student name is “???”. And save the reading by using a function

Create another function to show all the grade in that object.

Create the third function that can display the maximum grade and the student’s name.

Create a sorting function that can sort the arrays based on the student’s grade.

Display all the grades and names sorted by the grade.

In: Computer Science

You are holding a party at home, and everyone is about to participate in the following...

You are holding a party at home, and everyone is about to participate in the following game.

Each person will write their name on a card. All the cards will then be collected and randomly redistributed (one per person). If anyone gets back the card with their own name then all the cards will be collected and randomly distributed again, and this process will be repeated until no-one is holding the card with their own name.

When everyone has a card with someone else’s name on it, you will call out the name on your card. The called person will then call out the name on their card, and so on, until finally your own name is called out.

If anyone’s name does not get called out at some stage during this game, they will have to drink a whole 1 litre bottle of vodka by midnight.

(a) Suppose that there are five people at your party (including yourself).

(i)Find the probability that no one will have to drink 1 litre of vodka by midnight.

(ii)Then find the expected number of people who will have to drink 1 litre of vodka by midnight.

(b) Derive general formulas for the probability and expectation in (a), ones which are correct for any number of people attending your party (i.e. 2, 3, 4, etc.).

(c)Then apply these two formulas to the cases where there are 2, 3, 4, 5, 10 and 100 people at your party, respectively. Present your results in a table.

(very appreciated write in details, thank you very much)

In: Statistics and Probability

You have been appointed as the Project Manager for a New Product Launch Project by your...

You have been appointed as the Project Manager for a New Product Launch Project by your company. You must prepare a set of documents for the project kick-off meeting coming up next month.

Task 1:

Prepare a Project Charter for the New Product Launch Project (according to the choice of your product as explained above).

Please use the Project Charter template given below

Name of the Project

Background
[Why is the project being undertaken? Describe an opportunity or problem that the project is to address.]

Goals

  • [specific & measurable goal 1]
  • [specific & measurable goal 2]
  • [specific & measurable goal 3]

Scope
[What will be the end result of the project? Describe what phases of work will be undertaken. It’s also important to mention what activities will not be included in this project.]

Key Stakeholders

Client       

[name]

Sponsor

[name]

Project manager

[name]

Project team members

[name], [name], [name], [name].


Project Milestones
[Identify the significant project milestones: start date, end date and invoicing dates to the client.]

Project Budget
[Describe the main project expenses: non-recurring & monthly recurring.]

Constraints, Assumptions, Risks and Dependencies

Constraints     

[Describe here potential factors that will impact the delivery of the project]

Assumptions

[Describe here conditions or situations that you are relying on in order to achieve project goals]

Risks and Dependencies

[What are the most significant risks? What things must happen before the project is delivered?]

In: Operations Management

In Angel, you will find a class called Employee. This class should include a constructor which...

In Angel, you will find a class called Employee. This class should include a constructor which sets name to blanks and salary to $0.00 and a constructor which sets name to a starting name and salary to a set amount. Additionally, the class should include methods to set the name and salary and return the name and salary. Create another method to return the name and salary nicely formatted as a string (hint – research the toString method).

You will create a new class called Manager that inherits from the class Employee. Add a field named department of type String. Supply a method toStringthat prints the manager's name, department, and salary. Remember, you may not change anything in the Employee class.

You will then create a test class that uses the Manager class. The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of 3 employee records, the program should output the information you entered.

Your program should be able to handle a maximum of 3 entries.

You may write the program as a console application or using dialog boxes.

Please remember to include the needed comments at the top of your .java file which will identify this

Hand in:

1. A typed copy of the algorithm

2. The printed copy of your UML Class Diagram

3. The printed copy of your working source code with comments

In: Computer Science

Create a class called Vehicle that includes four instance variables:      name, type,     tank size and...

Create a class called Vehicle that includes four instance variables:

     name, type,

    tank size and average petrol consumption.

  1. Provide 2 constructors, the first takes name and type as parameter, the second takes four parameters for the four instance variables. (2 pt)
  2. Provide also a method called distancePerTank that calculate the average distance that a vehicle can travel if the tank is full (multiplies the tank size by the average petrol consumption), then returns the value. (2 pt)
  3. Provide a toString method, where its returned value

If tank size and average petrol consumption are not given, then return:

Vehicle [name=”Corolla”, type=”Sedan” ]

Otherwise its returned value:

Vehicle [name=”Corolla”, type=”Sedan”, tank Size=50.00 liters, average petrol consumption =22.00 liter/KM, can cross 1100.00 per tank]

(3 pt)

  1. Write a driver class to test the class Vehicle using different versions of the constructor and the toString method. (3 pt)

Running example:

Vehicle [name=”Corolla”, type=”Sedan” ]

Vehicle [name=”A5”, type=”Coupe” ]

Vehicle [name=”Mustange”, type=”Sport”, tank Size=60.00 liters, average petrol consumption =8.00 liter/KM, can cross 480.00 per tank ]

Vehicle [name=”Civic”, type=”Sedan”, tank Size=47.00 liters, average petrol consumption =15.00 liter/KM, can cross 705.00 per tank ]

In: Computer Science

Create a program that will prompt for user information for a Web site. Use a structure...

Create a program that will prompt for user information for a Web site. Use a structure to store the data. The structure will need to include the following items:

  1. First Name - string
  2. Last Name - string
  3. Full Name - string
  4. Birth Date   - int (assume format yyyymmdd)
  5. IsLeasingAutomobile - bool
  6. yearlySalary - float

Create a single structure from the items listed above.

Prompt for all items except "Full Name" and load the input directly into a variable based on this structure .

After the data is loaded, pass the structure by reference to a method called "loadFullName". Inside the "loadFullName" method, load the Full Name data item with a string that is a combination of First Name, space, Last Name. The full name must be converted to uppercase. After the loadFullName has executed, display the value of all the data items in the variable structure.

Review of tasks:

a. Create User Structure
b. Assign a Variable to a User Structure
b. Load the Variable Structure Data
c. Pass the Variable Structured Data to "loadFullName"
d. Display the values of the variable structure.

Note: Input for a boolean var is 0 for false and 1 for true. Adding this line to display once will help display the word false or true in the output.
std::cout << std::boolalpha; 
cout << "is Leasing = " << VarStrucName.isLeasingAutomobile << endl;  // will display true or false - with not 0 being true

In: Computer Science

Given is a Python program that connects to a sqlite database and has one table called...

Given is a Python program that connects to a sqlite database and has one table called writers with two columnns:

  • name - the name of a writer
  • num - the number of works the writer has written

The writers table originally has the following data:

name, num

Jane Austen,6

Charles Dickens,20

Ernest Hemingway,9

Jack Kerouac,22

F. Scott Fitzgerald,8

Mary Shelley,7

Charlotte Bronte,5

Mark Twain,11

Agatha Christie,73

Ian Flemming,14

J.K. Rowling,14

Stephen King,54 Oscar Wilde,1

Update the Python program to ask the user if they want to update entries or add new entries. If the name entered already exists in the writers table then the database record is updated, overwriting the original contents. If the name does not exist in the writers table, then add a new record with the writer's name and number of works. The following TODO sections must be completed.

  • Check if a writer exists in the writers table
  • If the writer exists in the table, locate an entry to be updated by writer's name and update the writer's value for num
  • If the writer does not exist in the table, add a new entry in the writers table and provide the value for name and num

Ex: If the input is:

y

J.K. Rowling 30

y

Elton John

y

62

n

What is output. Getting nothing but errors with existing help. Again, this is for Python3

In: Computer Science

Please provide step by step detailing on how i should do this assignment. In Angel, you...

Please provide step by step detailing on how i should do this assignment. In Angel, you will find a class called Employee. This class should include a constructor which sets name to blanks and salary to $0.00 and a constructor which sets name to a starting name and salary to a set amount. Additionally, the class should include methods to set the name and salary and return the name and salary. Create another method to return the name and salary nicely formatted as a string (hint – research the toString method). You will create a new class called Manager that inherits from the class Employee. Add a field named department of type String. Supply a method toString that prints the manager's name, department, and salary. Remember, you may not change anything in the Employee class. You will then create a test class that uses the Manager class. The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of 3 employee records, the program should output the information you entered. Your program should be able to handle a maximum of 3 entries. You may write the program as a console application or using dialog boxes. Also, please provide explanation on how to create each class on java eclipse so that the code can run successfully. Please provide description for everything, I’m a beginner trying to do this assignment.

In: Computer Science