Question

Notes on Testing • Unit Testing - creates a test case for each module of code that been authored. The goal is to ensure corre
design, find and fix the logic errors. Once each test case gives the expected results you are finished. Note that an implem
Post-conditions Correct message displayed End of document

JAVA
0 0
Add a comment Improve this question Transcribed image text
Answer #1

HI,

Please find below code written in JAVA. Also I have attached program and output screenshot for your reference.

Code:-

import java.util.Scanner;

public class Temperature{

public static void main(String []args){
  
int temp;
  
Scanner sc = new Scanner(System.in);
  
while(sc.hasNextInt())
{
  
temp = sc.nextInt();
  
if(temp <= 32)
{
System.out.println("Today is a Cold day!");
}
else if(temp <= 85)
{
System.out.println("Today is a Nice day!");
}
else
{
System.out.println("Today is a Hot day!");
}
}
}
}

1 import java.util.Scanner; 3 public class Temperature{ public static void main(String []args) { int temp; Scanner sc = new SNOUT O UN $javac Temperature.java $java -Xmx128M -Xms 16M Temperature Today is a cold day! Today is a nice day! Today is a co

Add a comment
Know the answer?
Add Answer to:
JAVA Notes on Testing • Unit Testing - creates a test case for each module of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Explain why each is right or wrong Documentation and testing Unit testing should only test common...

    Explain why each is right or wrong Documentation and testing Unit testing should only test common input cases Unit testing is a type of verification The main method of a class should perform extensive unit testing of the class unless it is the class driving the execution of a program All programs/classes should have a README file which clearly describes what the program/class does, how it is implemented, how it is used, whom wrote the code and bug fixes All...

  • I am writing a Python program to serve as a fitness tracker. I would love some...

    I am writing a Python program to serve as a fitness tracker. I would love some input as to how you would code this. I've included what I want this program to accomplish, what I will keep track of, and below all of that I have posted the assignment guidelines. Any suggestions on how to make this better/ more efficient would be welcome! I'm thinking of making a weekly tracker that takes input per day, and outputs at the end...

  • I need help with the following. I need to write a program code in Java using...

    I need help with the following. I need to write a program code in Java using NetBeans. It is from How to Program Java book Chapter 2. This program should calculate the packing of Candles. First read: The number of candles The number of candles that fit in each case Then calculate and print: The number of full cases The number of candles left over (partial case) If this order is large (more than 5 full cases needed) An extra...

  • Advanced Object-Oriented Programming using Java Assignment 4: Exception Handling and Testing in Java Introduction -  This assignment...

    Advanced Object-Oriented Programming using Java Assignment 4: Exception Handling and Testing in Java Introduction -  This assignment is meant to introduce you to design and implementation of exceptions in an object-oriented language. It will also give you experience in testing an object-oriented support class. You will be designing and implementing a version of the game Nim. Specifically, you will design and implement a NimGame support class that stores all actual information about the state of the game, and detects and throws...

  • Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit....

    Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating- point number for the temperature and a character for the scale, eitherでfor Celsius or 'F' for fahrenheit. The class should have Four constructors: one for the number of degrees, one for the scale, one for both the degrees and scale, and a default constructor. For each of these constructors, assume zero degrees if no value is specified and celsius if no...

  • Office Note This 78-year-old male returns to the office today to follow-up on diagnostic testing completed...

    Office Note This 78-year-old male returns to the office today to follow-up on diagnostic testing completed due to his ongoing muscle aches, myalgia, stiffness, and muscle weakness. Laboratory testing: Urinalysis was positive for hemoglobin. The urine myoglobin test and serum myoglobin test were both positive. The serum CPK value was high. Following these values additional testing was completed that confirmed elevated muscle enzymes in the blood. Because of these findings a diagnosis of rhabdomyolsis was confirmed. Plan: I discussed with...

  • This program should test the running time of these algorithms: Selection Sort Insertion Sort Bubble Sort...

    This program should test the running time of these algorithms: Selection Sort Insertion Sort Bubble Sort Merge Sort Quick Sort Heap Sort You have access to the implementation of all of these sorting algorithms, and you may use what is provided in your text directly. Be sure to cite the source of these implementations in the header of your program. Please maintain the property that these sorting algorithms sort arrays in ascending order. For this homework, you will write a...

  • We have been learning about the Logical Expression based method for developing test coverage. In this...

    We have been learning about the Logical Expression based method for developing test coverage. In this assignment, we will use these techniques to discover and define test case information for the provided Thermostat class (and supplemental ProgrammedSettings, Period, and Daytime class), and convert them into JUnit/NUnit Test Cases. Develop a suite of test cases to satisfy the Predicate Coverage for the Thermostat class Example of a Test Case: P = (((A < B) ∨ (C ∧ A < D)) ∧...

  • Variable Size Array with Classes, Testing. Study Code and Object Definition Windows of Microsoft ...

    Variable Size Array with Classes, Testing. Study Code and Object Definition Windows of Microsoft Visual Studio described here. As you work on the below project, demonstrate to the instructor the usage of this feature. Create a project titled Lab11_VarArrayTest. Implement the dynamically expanding and contracting array of doubles described in the previous lab as a class. You should use this class definition. The class attributes are a pointer to the dynamically allocated array dAarray and the array size size This...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT