Write an outdoor temperature monitoring application that allows a user to keep entering daily high temperature readings (in Fahrenheit) until the user enters 888.
If the temperature entered is less than -20 or more than 120, display an appropriate message and do not use the temperature.

Answers

Answer 1

An outdoor temperature monitoring application  is given below:

package pack10;

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

System.out.println("Enter daily high temperature readings (in Fahrenheit) ");

int input;

int numDays=0;

int highTemp=-999;

int lowTemp=999;

double average=0;

while(true) {

System.out.print("Enter temperature : ");

input = sc.nextInt();

if(input==555) {

break;

}

if(input<-20 || input>120) {

System.out.println("Error!!! Please enter temperatur in range -20 to 120 exclusive");

}else {

numDays++;

if(input>highTemp) {

highTemp = input;

}

if(input<lowTemp) {

lowTemp = input;

}

average += input;

}

}

System.out.println("Number of days the temperature entered : "+numDays);

System.out.println("The minimum temperature is : "+lowTemp);

System.out.println("The maximum temperature is : "+highTemp);

average/=numDays;

System.out.println("The average of the temperature is : "+average);

}

}

What is a program?

A computer program is a set of instructions written in a programming language that a computer can execute. Software includes computer programs as well as documentation and other intangible components. Source code refers to a computer program in its human-readable form.

The outdoor temperature monitoring application that allows a user to keep entering daily high temperature readings is illustrated above.

Read more about programming here:

https://brainly.com/question/23275071

#SPJ1`


Related Questions

So I'm doing a coding project again and I have to recreate a website I'm having difficulty getting my website to look like the one I'm recreating I have put a screenshot of the website I need I recreate and a picture of the code I have so far

Answers

HTML and CSS tutorials

Explanation:

Search for website tuturials

Question 7 of 10
is a rate that charges interest on the interest that accumulates on debt.
O A. Simple interest
OB. Variable interest
O C. Principal interest
OD. Compound interest
SUBMIT

Answers

Compound interest is a rate that charges interest on the interest that accumulates on debt.

What is an interest?

Interest is the payment of an amount above the principal sum by a borrower or deposit-taking financial institution to a lender or depositor at a specific rate. It differs from a fee that the borrower may pay to the lender or a third party. It is also distinct from a dividend, which is paid by a company to its shareholders (owners) from its profit as well as reserve, but not at a fixed rate, but rather on a pro rate basis as a share of the reward gained by risk-taking entrepreneurs when revenue exceeds total costs.

When interest is compounded on the principal amount invested as well as borrowed, the interest rate is applied to the new (larger) principal. It's essentially interest on interest, which leads to exponential growth over time.

So, D is the right answer.

To learn more about interest

https://brainly.com/question/16134508

#SPJ9

I would like to create crossword puzzles in Java. Two 4X4 and two 6X6 puzzles. How do I go about it?

Answers

One of the ways to create crossword puzzles in Java using GUI is given below:

The Program

import java.awt.BorderLayout;

import java.awt.FlowLayout;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.util.Random;

The program is attached in the file below as the profanity counter is rejecting the code here, so I cannot post it here.

Read more about java programming here:

https://brainly.com/question/18554491

#SPJ1

Write a program to display the s
tandard/deviation of 100 sets of numbers already stored in an array​

Answers

import random

import statistics

number = [1, 2, 3, 4, 5]

print("Standart deviation is: ", statistics.stdev(number))

Please edit the array before compiling the code.

Discuss in brief the major of components of computer network?

Answers

The major components required to install software are computer network components. NIC, switch, cable, hub, router, and modem are all important network components. Some network components can be removed depending on the type of network that needs to be installed. A wireless network, for example, does not require a cable.

The following are the major components needed to set up a network:

1)NIC: NIC is an abbreviation for network interface card. A network interface card (NIC) is a piece of hardware that connects one computer to another on a network. It has a transfer rate range of 10,100 to 1000 Mb/s.

2)Hub: A hub is a piece of hardware that divides a network connection among multiple devices. When a computer requests information from a network, it first sends the request via cable to the Hub. This request will be broadcast to the entire network by Hub.

3)Switch:A switch is a piece of hardware that connects multiple devices on a computer network. A Switch has more sophisticated features than a Hub.

4)Router: A router is a piece of hardware that connects a local area network (LAN) to the internet. It receives, analyses, and forwards incoming packets to another network. A router operates on the OSI Reference Model's Layer 3. A router routes a packet based on the information in the routing table.

5)Modem: A modem is a piece of hardware that allows a computer to connect to the internet via an existing telephone line. A modem is not built into the motherboard; rather, it is installed in a PCI slot on the motherboard.

6)Cables: A cable is a type of signal transmission medium.

What is computer network?

A computer network is a group of computers that share resources on or provided by network nodes.

To learn more about computer network

https://brainly.com/question/1167985

#SPJ9

Other Questions
find the value of x for which r parallels s. then find the measures of angles 1 and 2 measure angle 1= 80-2xmeasure angle 2= 93-3xthe value of x for which r parallels s is....measure of angle 1 is.....measure of angle 2 is..... your chief information security officer (ciso) wants to develop a new collection and analysis platform that will enable the security team to extract actionable data from its assets. the ciso would like your input as far as which data sources to draw from as part of the new collection platform, worrying that collecting from too many sources, or not enough, could impede the company's ability to analyze information. is this a valid concern, and how can it be addressed within an intelligence life-cycle model? classify given equation as rational or irrational:2 root 3 + 3 root 2 - 4 root 3 + 7 root 2 Fill in the blank: 66 in. = yd 39+(20.4) can u help me with this answer I don't know how to do it Find the slope of the line through the given points . If the slope of the line is undefined state so (13,1) and (1,4) Alnico is _____.an alloy of metals with strong magnetic propertiesa brittle mixture of substances containing ferromagnetic elementsany material containing ironan element found in nature that behaves like a magnet The number of bottles a machine fills is proportional to the number of minutes the machine operates. The machinefills 250 bottles every 20 minutes. Create a graph that shows the number of bottles, y, the machine fills in a minutes.To graph a line, select the line tool. Click on a point on the coordinate plane that lies on the line. Drag your mouse toanother point on the coordinate plane and a line will be drawn through the two points which entity is responsible for monitoring the appraisal foundation to ensure it is properly fulfilling its responsibilities under title xi of firrea? use the values from practice it to help you work this exercise. what if an additional mass is attached to the ball? how large must this mass be to increase the downward acceleration by 35%? A water tank holds 276 gallons but is leaking at a rate of 3 gallons per week. A second water tank holds414 gallons but is leaking at a rate of 5 gallons per week. After how many weeks will the amount of waterin the two tanks be the same?The amount of water in the two tanks will be the same inweeks. you are considering a project with an initial cost of $4,300. what is the payback period for this project if the cash inflows are $550, $970, $2,600, and $500 a year for years 1 to 4, respectively? a) 2.04 years b) 2.36 years c) 2.89 years d) 3.04 years e) 3.36 years after three tests, brandon has a test average of 90. after his fourth test, his average dropped to an 85. what did he score on his fourth test? 9Use the expression 43 + 8 to find an example of each kind of expression.Kind of expression ExampleQuotient9SumyVariable43 + 8Stuck? Review related articles/videos or use a hint.Repc Need help with this question Short straight forward answers please :) in the absence of the carbohydrate a, genes x and y are expressed at low levels. when a is introduced, genes x and y are actively transcribed. when the supply of a is exhausted, the expression of x and y drops to very low levels. from this, we can conclude that a is a(n) the five key components of the business environment are the economic environment, technological environment, social environment, global environment, and what? A race car speeds up from 0 m/s to 40.0 m/s in 4 seconds. What is the vehicle's acceleration?A. 16 m/sB. 10.0 m/sC. 4.0 m/sD. 8.0 m/s PLEASE HELP 50 POINTS AND MARKED AS BRAINLIEST A spring scale is a device that uses a spring with a known spring constant to measure the weight of objects. You have a spring scale with a spring constant of 13 Nm. How much will the spring stretch when a 12-N weight is hung from one end? how does terrell describe the living conditions for african-americans in washington, d.c., during this period?