Code:
using System.IO;
using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
string input;
int value;
List<int> myList = new List<int>();
Console.WriteLine("Enter windspeed in mph(To exit type any
character)");
input=Console.ReadLine();
while(int.TryParse(input ,out value))
{
if(value>0)
myList.Add(value);
Console.WriteLine("Enter windspeed in mph(To exit type any
character)");
input=Console.ReadLine();
}
int max=0;
foreach (int i in myList)
{
//Console.WriteLine("i is {0}",i);
if(i>max)
max=i;
}
Console.WriteLine("Storm\t\t\t\t\tMPH");
foreach (int i in myList)
{
if(i<74)
Console.WriteLine("Tropical-storm not a typhoon\t\t{0}",i);
else if(i>= 74 && i<=95)
Console.WriteLine("1\t\t\t\t\t{0}",i);
else if(i>=96 && i<=110)
Console.WriteLine("2\t\t\t\t\t{0}",i);
else if(i>=111 && i<=130)
Console.WriteLine("3\t\t\t\t\t{0}",i);
else if(i>=131 && i<=155)
Console.WriteLine("4\t\t\t\t\t{0}",i);
else if(i>=156)
Console.WriteLine("5\t\t\t\t\t{0}",i);
}
Console.WriteLine("The max value entered is {0}", max);
}
}
Output:
Enter windspeed in mph(To exit type any character)
74
Enter windspeed in mph(To exit type any character)
70
Enter windspeed in mph(To exit type any character)
-175
Enter windspeed in mph(To exit type any character)
75
Enter windspeed in mph(To exit type any character)
131
Enter windspeed in mph(To exit type any character)
111
Enter windspeed in mph(To exit type any character)
p
Storm MPH
Tropical-storm not a typhoon 70
1 74
1 75
4 131
3 111
The max value entered is 131
C# programming Create an application that prompts the user for a storm windspeed in mph, then...
In MATLAB how do you write a program to determine what type of tropical system and/or category hurricane a system is depending on the wind speed. For example winds in a tropical system at 35 MPH means that the system is a tropical depression. If the winds are at 50 MPH, then the system is a tropical storm. If the winds are at 100 MPH, the system is a category two hurricane. Also, write a similar program on the Fujita...
Write a Java application that prompts the user for pairs of inputs of a product number (1-5), and then an integer quantity of units sold (this is two separate prompts for input values). You must use a switch statement and a sentinel-controlled loop (i.e. a loop that stops execution when an out of range value, such as -1, is input). All 15 items below are for a single purchase. There are five sets of inputs as follows: Product 1 1...
Write a multi-file program for a meteorologist that calculates the wind chill factor and cloud base altitude for the inputs temperature in Fahrenheit, wind speed in mph, and the dew point in Fahrenheit. Allow the user to run the program multiple times without having to restart the program and clear the console window between sessions using system (“CLS”) which requires the cstdlib library. The program must have the following four (4) functions called from main and located in a header...
Write in JAVA Get Familiar with the Problem Carefully read the program description and look at the data file to gain an understanding of what is to be done. Make sure you are clear on what is to be calculated and how. That is, study the file and program description and ponder! Think! The Storm Class Type Now concentrate on the Storm class that we define to hold the summary information for one storm. First, look at the definition of...
C Programming Quesition (Structs in C): Write a C program that prompts the user for a date (mm/dd/yyyy). The program should then take that date and use the formula on page 190 (see problem 2 in the textbook) to convert the date entered into a very large number representing a particular date. Here is the formula from Problem 2 in the textbook: A formula can be used to calculate the number of days between two dates. This is affected by...
I need help programming this question using C language. This program uses input data entered in command line at the same time when the command or .exe file is entered. They are called command-line arguments. Because everything entered in command line is taken as a string, these arguments including the command itself or the .exe file name are stored in an array of char pointers, each pointer points to the first character of a string (i.e., argument). The inputs can...
Your assignment is to create a restaurant ordering system where
the cashier can create the menu and then take in the order and
display the order back to the customer
Sample Execution – Level 1
Welcome to your Menu Creation system.
How many items would you like to have on your menu? 2
Create your menu!
Enter item #1: Coffee
Enter item #2: Tea
This is the menu:
Coffee
Tea
What would you like to order? Cake
That isn’t on...
CODE MUST BE IN C++ Objective Create a program that provides the solution to a quadratic equation. Background: A quadratic equation can be generalized by equation below: f ( x )=ax2+ bx +c Closed form solutions can be found for the zeros of a quadratic function conveniently. That is the locations where the function is equal to zero can be found by the following equation: x=− b± √ b −4ac 2a Note that depending on the sign of the expression...
This is a C++ assignment that I'm trying to create and would like some help understanding while loops, with possible integration of for loops and if statements. This program only uses while, for, and if. I have some code that I have started, but where to go from there is what's giving me some trouble. This is involves a sentinel controlled while loop, and there are a lot of specifications below that I must have in the program. The program...
This is a C++ assignment that I'm trying to create and would like some help understanding while loops, with possible integration of for loops and if statements. This program only uses while, for, and if. I have some code that I have started, but where to go from there is what's giving me some trouble. This is involves a sentinel controlled while loop, and there are a lot of specifications below that I must have in the program. The program...