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

  Create a diagram showing the frequencies that will be used

Create a table or diagram showing the frequencies/channels that will be used for your network design and the locations where frequencies/channels will be used.

  Define a variable to input

Define a variable to input 2n digits and then input two long integers of 2n-digit. Calculate a as 10^nA1+A0 and b as 10^nB1+B0.

  Write a routine to clip ellipse against a rectangular window

Write a routine to clip an ellipse against a rectangular window. Develop a text-clipping algorithm that clips individual characters.

  What are your impressions of the noun technique

Create a UML class diagram using the classes you have identified and add names to the associations and multiplicity constraints. What are your impressions of the noun technique?

  Write a program to implement dynamic motion specifications

Write a program to implement dynamic motion specifications. Specify a scene with two or more objects, initial motion parameters, and specified forces.

  From the code of ethics reading, focus on section one

General Moral Imperatives. How do these affect you as a student. How will they affect you as you move into the professional workplace

  Find and display the account balances

This assessment item is designed to test your understanding of arrays/arraylists, objects, classes, methods,sorting and searching.

  Discuss the major principles for user interface design

Suppose that your uncle is a real estate agent and he decided to have a web-site to list his available real estate properties.

  How far away is the plane from its starting point

Roughly in what direction is the resultant velocity? What ist he resultant speed of the airplane? How far away is the plane from its starting point?

  How many register windows must be saved to memory

How many register windows must be saved to memory.

  List the six different types of data compare instructions

List the six different types of data compare instructions. Describe an industrial situation where one of these types of data compare instructions could be used.

  What is the average mips rate of the program

If the clock period is 0.2 its, calculate the average CPI for the program. What is the average MIPS rate of the program?

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