- Java Programming - Develop JUnit test for a designated program - Perform JUnit testing for...

- Java Programming

- Develop JUnit test for a designated program

- Perform JUnit testing for on method that return both successful and unsuccessful results

- Create a JUnit test class for testing the getAverageScore and the getTotalScore methods.   On class per test.

public class Student
{
  
private String name;

private double totalScore;
  
private int quizCount;
  
public Student()
{
name = "";
totalScore = 0;
quizCount = 0;
}
n the name
*/
public Student(String n)
{
name = n;
totalScore = 0;
quizCount = 0;
}

public void setName(String aName)
{

name = aName;

}

public String getName()
{
return name;
}

public void addQuiz(int score)
{
if(score >= 0 && score <= 100)
{
totalScore = totalScore + score;
quizCount = quizCount + 1;
}
else
{
System.out.println("Score must be between 0 and 100, inclusive");
  
}
}

public double getTotalScore()
{
return totalScore;
}


public double getAverageScore()
{
return totalScore / quizCount;
}


}
----------------------

import java.util.Scanner;

public class StudentTester
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String repeat = "n";
int currentScore = 0;
  
System.out.print("Enter Student's name: ");
String sName = keyboard.nextLine();
  
Student student1 = new Student(sName);
  
do
{
System.out.print("Enter quiz score: ");
currentScore = keyboard.nextInt();
  
student1.addQuiz(currentScore);

System.out.print("Do you wish to enter another score, (Enter y for Yes, n for no: " );

keyboard.nextLine();
repeat = keyboard.nextLine();
  
}while(repeat.equalsIgnoreCase("y"));
  
String studName = student1.getName();
double totalScore = student1.getTotalScore();
double avgScore = student1.getAverageScore();
  
  
  
System.out.printf("%s total quiz score is: %,2f and average quiz score is: %6.2f \n", studName, totalScore, avgScore);
  
  
Student student2 = new Student();

In: Computer Science

this is a C++ question. 1 Write a program that returns the count of the occurences...

this is a C++ question.

1 Write a program that returns the count of the occurences of 8 as a digit within an integer.The input to the program should be an integer, not a string.For example 848 yields 2 .You are expected to solve this using a recursive function (no loops)
Hint:Note that mod (%) by 10 yields the rightmost digit (787 % 10 is 7 ) while division by 10 removes the rightmost digit (787/10 is 78)

In: Computer Science

1. The isoelectric point of casein is 4.6. Milk has a pH of 6.6. What does...

1. The isoelectric point of casein is 4.6. Milk has a pH of 6.6. What does prolein look like in milk, (overall negative -, overalll positive +, or neutral with both – and + charges)?

In: Chemistry

Imperial Jewelers is considering a special order for 19 handcrafted gold bracelets to be given as...

Imperial Jewelers is considering a special order for 19 handcrafted gold bracelets to be given as gifts to members of a wedding party. The normal selling price of a gold bracelet is $407.00 and its unit product cost is $269.00 as shown below:

Direct materials $ 147
Direct labor 87
Manufacturing overhead 35
Unit product cost $ 269

Most of the manufacturing overhead is fixed and unaffected by variations in how much jewelry is produced in any given period. However, $8 of the overhead is variable with respect to the number of bracelets produced. The customer who is interested in the special bracelet order would like special filigree applied to the bracelets. This filigree would require additional materials costing $7 per bracelet and would also require acquisition of a special tool costing $453 that would have no other use once the special order is completed. This order would have no effect on the company’s regular sales and the order could be fulfilled using the company’s existing capacity without affecting any other order.

Required:

What effect would accepting this order have on the company’s net operating income if a special price of $362.00 per bracelet is offered for this order? (Enter all amounts as positive values.)

Per Unit Total 19 Bracelets

Incremental revenue

Incremental costs:

Variable costs:

Direct materials

Direct labor

Variable manufacturing overhead

Special filigree

Total variable cost

Fixed costs:

Purchase of special tool

Total incremental cost

Incremental net operating income (loss)

Note: Per Unit and Total 24 Bracelets

In: Accounting

A curve of radius 73 m is banked for a design speed of 75 km/h ....

A curve of radius 73 m is banked for a design speed of 75 km/h . If the coefficient of static friction is 0.39 (wet pavement), at what range of speeds can a car safely make the curve?  [Hint: Consider the direction of the friction force when the car goes too slow or too fast.] Express your answers using two significant figures separated by a comma. (v min, v max in km/h)

In: Physics

1) a. consider a ball of m= 0.50kg. does it take the same amount of additional...

1) a. consider a ball of m= 0.50kg. does it take the same amount of additional energy to vertically lift it from 25cm to 30cm as it does to lift from 30cm to 35 cm? if not, which takes more. Why?


b. does it take the same amount of additional energy to speed your car (mass m=1000 kg) up from 25m/s to 30m/s as it does to speed it up from 30m/s to 35m/s? if not which takes more? Why?


c. consider a spring with k=10N/m. Does it take the same amount of additional energy to stretch the spring from 25cm to 30 cm as it does to stretch it from 30cm to 35 cm? If not, Which takes more? why?


Please explain each part thanks!.

In: Physics

For this assignment you will write a C++ program to read a list of words and...

For this assignment you will write a C++ program to read a list of words and sort them in alphabetical order.

Requirements:

  • You must use a bubble sort OR selection sort algorithm - your choice. You do NOT need to do both.
  • You must print the sorted list of words to the console standard out (cout).
  • You must use a vector object to store the list of words and you must sort the list "in-place" (meaning, do not create a new list.)
  • When reading the data, your program must ignore blank lines and any line that begins with the # symbol.

NOTES:

  • Part of the grade will be based on comments according to the style guide.
  • You can implement a class if you want to. Writing a class is not required for this assignment.
  • Don't make any assumptions about the input data. I may grade using a completely separate list of words. (if so, the format will be the same - no more then one word per line. But assume that blank lines and comments can occur anywhere in the file.)

word_list.txt

_____________________________________________________________________________________________________________________________________below:

# Read the list of words below and write them out in alphabetical order.
# Your program should skip over the blank lines. 
goal
interesting
successful
job
experience
career

manage
responsibility
technology
purpose
beautiful
wonder
opportunity
leader
quality

knowledge
victory
nature
ability
dream
understand
future
hope

In: Computer Science

26.  Complete three and only three of the following: Outline the summary of events in the β-adrenergic...

26.  Complete three and only three of the following:

  1. Outline the summary of events in the β-adrenergic receptor signal transduction pathway.2.
  2. Define the Cooperativity Index (AKA Saturation Ratio) and review its significance with regard to the function of enzymes and ligand binding proteins.3.
  3. Discuss hormonal regulation of glycogen synthesis and breakdown.4
  4. Give a summary of hormonal regulation of triglyceride metabolism in adipocytes.5.
  5. Discuss the choice of substrate concentrations for enzyme kinetic experiments to determine KM. To determine Vmax.6.
  6. Review hormonal regulation of gluconeogenesis and glycolysis in liver.

In: Biology

A company issues a 25-year $6500 bond, redeemable at 95 with bond interest at j1= 6%....

A company issues a 25-year $6500 bond, redeemable at 95 with bond interest at j1= 6%. The bond is callable at the end of 15 years for $5425 or at the end of 20 years for $6870. Determine the price to guarantee the investor a yield of j1 = 10%.

In: Finance

define with details the income statement and the balance sheet, highlighting the purpose, benefits, and differences...

define with details the income statement and the balance sheet, highlighting the purpose, benefits, and differences between the two.

In: Accounting

Shelly's Boutiques and Crafts had revenue of $5,700,000 this year on sales of 575,000 units. Variable...

Shelly's Boutiques and Crafts had revenue of $5,700,000 this year on sales of 575,000 units. Variable costs were 35% and fixed costs totaled $3,150,000. Although the first five years were relatively profitable, increases in competition have led to a negative trend in profitability that has led them to the point where they have to make some changes to stay afloat. The company is evaluating two options to stay afloat.

Option 1:Purchase machinery to automate their operations. This machinery costs $625,000, but will decrease variable costs by 9%.

Option 2:Outsource the production of one of their main components that requires a substantial amount of machinery and skilled labor. This will reduce fixed costs by $425,000, but increases variable costs from their current 35% of sales to 40% of sales.

d.) Calculate the break even point in units after applying Option 1: What is the new fixed cost in total? What is the new contribution margin per unit? What is the new break even point in units?

In: Accounting

Java program written with one file not two .... Make a LandTract class with the following...

Java program written with one file not two ....

Make a LandTract class with the following fields:

• length - an int containing the tract's length
• width - an int containing the tract's width

The class should also have the following methods :

• area - returns an int representing the tract's area
• equals - takes another LandTract object as a parameter and returns a boolean saying
whether or not the two tracts have the same dimensions (This applies regardless of whether the dimensions match up. i.e., if the length of the first is the same as the width of the other and vice versa, that counts as having equal dimensions.)
• toString - returns a String with details about the LandTract object in the format:
LandTract object with length 30 and width 40
(If, for example, the LandTract object had a length of 30 and a width of 40.)

Write a separate program that asks the user to enter the dimensions for the two tracts of
land (in the order length of the first, width of the first, length of the second, width of the second). The program should print the output of two tracts' toString methods followed by a sentence stating whether or not the tracts have equal dimensions. (If the tracts have the same dimensions, print, "The two tracts have the same size." Otherwise, print, "The two tracts do not have the same size.") Print all three statements on separate lines.

****Results have to look like this****

Enter·length·of·first·land·tract:10↵
Enter·width·of·first·land·tract:55↵
Enter·length·of·second·land·tract:36↵
Enter·width·of·second·land·tract:75↵
LandTract·with·length·10,·width·55,·and·area·550↵
LandTract·with·length·36,·width·75,·and·area·2700↵
The·two·tracts·do·not·have·the·same·size.↵

In: Computer Science

Lab4: Functions, Procedures, and Testbenches in vivado Conclusion: Question4: How are statements executed inside of a...

Lab4: Functions, Procedures, and Testbenches in vivado Conclusion:

Question4: How are statements executed inside of a procedure?

Question6: How are statements executed inside of a function?

Question7: What is the difference between inertial delay and transport delay?

Question8: What is the purpose of having the use STD.textio.all; statement in the testbench file?

Question9: Why do we not have any ports declared in the entity of a testbench?

Question10: Describe what happens inside the architecture portion of a testbench design.

In: Computer Science

In Java Create an interface GainsInterest that contains two method signatures with public access modifiers for...

In Java

Create an interface GainsInterest that contains two method signatures with public access modifiers for compound daily and interestAccrued that both return BigDecimal.

Create an abstract Account class and a SavingsAccount that derives from it using best programming practices. Define an account balance that is set in the constructor of SavingAccount and passed to the constructor of the Account. SavingsAccount should implement GainsInterest, but you do not need to provide implementation for those methods beyond defining the method inside in the class and returning BigDecimal.ZERO.

In: Computer Science

Calculate the pH in the titration of 50mL of a .2M acetic acid and .312M NaOH...

Calculate the pH in the titration of 50mL of a .2M acetic acid and .312M NaOH Ka = 1.8x10^-5

- 5 mL before equivalence point

In: Chemistry