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

  How can we determine a maximal spanning tree in a network

The topological sorting functions as presented in the text are deficient in error checking. How can we determine a maximal spanning tree in a network?

  The relationships between user forms and reports

the relationships between user forms and reports

  Compute the bubble point temperature for mixture containing

Compute the bubble point temperature for mixture containing 10 mole % 1-propanol, 70 mole % 1-butanol, and 20 mole % 1-pentanol at pressure equal to 1000 mm Hg.

  Write down an expression that evaluates to true

Given variables isFullTimeStudent and age , write an expression that evaluates to true if age is less than 19 or isFullTimeStudent is true.

  Body language conveys non-verbal cues to the recipient of

body language conveys nonverbal cues to the recipient of any given communication. explain the five nonverbal methods of

  Create appropriate functions for these classes

Create appropriate functions for these classes, and write a main()function that instantiates and uses objects of each class.

  Determine the temperature of the outer glass layer

A vertical 1.5-m-high, 2.8-m-wide double-pane window consists of two layers of glass separated by a 2.0-cm air gap at atmospheric pressure.

  Determine technology which has changed cafe,coffee shop

Determine technology which has changed cafe,coffee shop? Think things such as marketing, food preparation, inventory ordering or re-ordering, customer tracking, and more.

  Write down code to complete the conversion

Include a Reset button, which will clear the interface controls.Write down code to complete the conversion.

  Define what use a read-only memory

define what use a read-only memory (ROM) serves in the design of a computer system. What type of information is kept in a ROM, and how does that information originally get into the memory?

  Write a review paper about ethical concerns in computing

Write a review paper about Ethical Concerns in Computing. The INF103 tutorial will walk you through the basic steps of doing a search for scholarly articles within the Ashford University Library.

  Prompt the user to input a length expressed in centimeters

The program should then convert the length to inches (to the nearest inch) and output the length expressed in yards, feet, and inches.

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