Display a table showing the days and the temperatures

Assignment Help Computer Engineering
Reference no: EM132200873

Write a Java program that contains a method named DisplayTemperature. The argument to this method is the number of days and the temperature on the first day.

The method is used to decrease the temperature by two degree every day in the first half of a given period and increase by one degree in the second half.

If the number of days in a specified period is odd, the first half will be considered a day less than the second half. The method then displays a table showing the days and the temperatures on those days (as shown below).

The main method in the program will first ask the users to enter the number of days in the specified period and the temperature on the first day (as shown below). The program should then call the DisplayTemperature method that outputs the table (as shown below).

For example, if a user enters as follows:

Number of days in the period: 11

Temperature on the first day: -10

The method should display the following:

day temperature

1 -10

2 -12

3 -14

4 -16

5 -18

6 -17

7 -16

8 -15

9 -14

10 -13

11 -12

Reference no: EM132200873

Questions Cloud

How many of the consecutive elements were repeated : Program will ask the user to enter the size of an array. It will create an integer array based on the size user entered.
What is the equilibrium consumption level : Suppose a consumer maximizes U(C,l) = ln(C) + ln(l), where C is consumption and l is leisure. The maximum time available for work and leisure is 1.
Write a java program that contains a method : The method opens the file specified in the method argument filename and then reads integers from it. This file can contain any number of integers.
What is the process of creating an er diagram : In SQL 9th edition how do I delete a table? And what is the process of creating an ER diagram?
Display a table showing the days and the temperatures : Write a Java program that contains a method named DisplayTemperature. The argument to this method is the number of days and the temperature on the first day.
Define a class named yourlastname : 1. Define a class named YourLastName, with the following methods:
Provide a careful explanation as to why given might be case : Regions under a single insurance policy rather than separate policies. The total premium under the combined policy is less than the total cost.
Write a java program to generate 6 random lottery numbers : Write a Java program to generate 6 random lottery numbers. Your program should generate 5 numbers between 1 and 60.
Write a java program that take as input any change expressed : Write a Java program that takes as input any change expressed in cents and computes the number of half-dollars, quarters, dimes, nickels.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Prompt the user for a character or string of characters

Write a new program that will prompt the user for a character or string of characters.

  What is the first step in performing risk management

What is the first step in performing risk management? What is the exercise called when you are trying to gauge how significant a risk is? What practice helps address a risk? What ongoing practice helps track risk in real time?

  Define the terms communication latency and flow dependence

Define the terms Communication latency, Flow dependence, Anti-dependence, Output dependence, HO dependence and Control dependence.

  Give string that contains more dashes than dots

Write down a seven-character string that contains more dashes than dots and is in the language. Show how you know that your reply is correct.

  Write recursive void function that takes single int argument

Write a recursive void function that takes a single int argument n and writes the integers 1, 2, . . . , n.

  How do you save your entire home directory structure

How do you save your entire home directory structure, including the hidden files, in a separate file?

  Create an undo tablespace with a single data file

Simulate a problem with undo. You will need to be connected as user SYSTEM or some other user to whom you have granted the DBA role.

  Specify the most significant merits and demerits that could

write a two to three 2-3 page paper in which you 1 specify the most significant advantages and disadvantages that could

  List the reasons you would give her to dissuade

List the reasons you (as a member of the same team as Bea) would give her to dissuade her from trying to scrap the SDLC and prototype every project.

  How do you place a breakpoint at the main function

Say you diff two files "FileA" and "FileB" using diff, and the result is 4d3. What change do you have to make in FileA to get it to match FileB?

  How the architecture can allow for options

In a system familiar to you, discuss how the architecture can allow for options to respond to changes in client demands.

  Complete the project using given information

In this project, you will be working with the pet store database from Chapter 3, Fix It 3.6. The store is currently having trouble with some queries.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd