Need help for this project in C

Wm having problem with getting this loop to work

#include <stdio.h>
#include <stdlib.h>

/* EEL4834 Assignment 3 Part 1 of project make the Heq Analyzer v1.0 */

int main(void)
{
int selection;
int year;
int hur;
int ts;


printf(" HEg v1.0\n");
printf(" ---------\n");

printf("0. Exit\n");
printf("1. Submit Hurricane Season Storm Information\n");
printf("2. Submit Storm Data\n");
printf("3. Print Hurricane Season Analysis\n");
printf("4. Print Storm Analysis\n\n");

printf("Enter Selection: ");
scanf("%d", &selection);

switch (selection)
{
case 0:
printf("Thanks for using HEg v1.0");
break;
case 1:
printf("Enter the year: ");
scanf("%d", &year);
printf("Enter the number of tropical storms in %d: ", year);
scanf("%d", &ts);
printf("Enter the number of hurricanes in %d: ", year);
scanf("%d", &hur);
int ws;
float knot;
printf("Enter Max windspeed for tropical storm #1: ");
scanf("%d", &ws);

for(ws<39; ws>73;)
{
printf("ERROR: Invalid windspeed for tropical storm #1. Try again");
}
knot = ws * (5280/6080);
printf("Windspeed in knots: %f", knot);



this is my project
Project – Part 1:
H-Engineering (HEg) is a new company that specializes in hurricane research. Recently the National Oceanic and Atmospheric Administration (NOAA) awarded a contract to HEg to develop a new software application that will do various analyses on hurricanes and tropical storms. This SW will be delivered to the customer in phases as specified in the contract.
Background:
Hurricane season in the Atlantic Basin, which includes the Caribbean and the Gulf of Mexico, officially runs June 1st to November 30th. Thus, NOAA needs to have a complete application by April. You became part of the software team responsible to develop the HEg Analyzer v1.0. The first phase of this project is to create a menu based application for the user to select an option to execute (See Instructions section).

For v1.0, NOAA only wants the input to be entered for a hurricane season for the Atlantic Basin. It’ll then print the number of hurricanes by category and the total wind speed for the season.

Instructions: (The highlighted data is what the user enters)
1. Display the software name and the following menu










2. Selection 0: Exits the program with a message: Thanks for using HEg v1.0
3. Selection 1: Lets the user submit the tropical storms and hurricane data for a particular year as follows:













4. After entering the year, the number of tropical storms and hurricanes, the software should ask the user to enter the wind speed (mph) for each tropical storm and each hurricane.
5. The software should automatically check the validity of each wind speed entered. Based on the chart below:


In other words, if the user enters 100 mph for a tropical storm, an Error Message should be displayed:
ERROR: Invalid wind speed for a tropical storm. Try again.

Similarly, display an Error Message if the user enters 15 mph for wind speed of a hurricane.
ERROR: Invalid wind speed for a hurricane. Try again.

The software should continuously ask the user to enter the correct value until a valid one is entered (Hint: Use a loop).














6. If the wind speed input is correct, the SW should print the wind speed in knots, as follows:











7. The software should also figure out the hurricane category based on the wind speeds, and keep a count of how many hurricanes are in each category.
8. It should also keep a running total of all the valid wind speeds.
9. After selection 1 is complete, display the menu again.
10. Selection 2: Since v1.0 doesn’t need to have functionality for selection 2, thus print an error message:
ERROR: Menu option not available in HEg v1.0

11. Selection 3: Prints the number tropical storms, the number of hurricanes for each category, and the total wind speed in knots. Be careful in not adding other year’s running total to the current one. Also, if the user didn’t enter any information for a particular hurricane season and selects #3, an error should occur:
ERROR: Hurricane Season data was not entered. Select Option 1.










12. Selection 4: Since v1.0 doesn’t need to have functionality for selection 4, thus print an error message:
ERROR: Menu option not available in HEg v1.0

Input Data: Use the following test data that was obtained from NOAA
Year: 2006
Storm Date Max wind (mph) Min press. (mbar)
1 June 10 – 14 70 995
2 July 17 - 18 50 998
3 July 18 – 21 60 1000
4 Aug 1 – 4 65 1001
5 Aug 21 – 26 50 999
6 Aug 24 – Sep 1 75 985
7 Sep 3 – 12 90 974
8 Sep 11 – 20 120 955
9 Sep 12 – 24 120 955
10 Sep 27 – Oct 2 85 985

Year: 2013
Storm Date Max wind (mph) Min press. (mbar)
1 June 5 – 7 65 992
2 Jun 17 – 20 45 1003
3 Jul 7 – 10 65 1003
4 Jul 23 – Aug 3 60 1002
5 Aug 15 – 18 45 1006
6 Aug 25 – 26 60 1001
7 Sep 4 – 13 65 1003
8 Sep 6 – 7 35 1009
9 Sep 8 – 19 90 979
10 Sep 12 – 17 85 983
11 Sep 29 – Oct 3 50 1005
12 Oct 3 – 6 65 998
13 Oct 21 – 24 50 1000
14 Nov 18 – 22 65 980

Last edited on
Topic archived. No new replies allowed.