please if anyone can help me write the code for this assignment i would greatly appreciate it.
also i dont know how to write the data in the file im pulling the data from.
the problems in this chapter would be much easier if you used loops, but we don't discuss loops until the next chapter. If you know how to set up a loop, feel free to do so. It will make it a lot easier.
So you read one line of data, do your if or switch and print the data. Then you read another line of data from the file and print the data, and finally read the 3rd line of data and print.
Copy and paste would be helpful.
Print your name at the top of each program. Use your name as the first bowler name.
1. Read in the bowler info below from a file. Calculate the average for the 3 games. If the average is 100 or below, print out bad bowler, if the average is 101-200, print out good bowler, else print out great bowler. Make sure to label everything.
Use a if statement with no else, which means 3 if statements.
your name, 200, 230, 240
charlie brown, 76,24, 13
linus, 144, 122, 176
2. Same thing as in number 1 above but this time use a if/else structure.
3. Input the data below from a file. A name and gender. Make sure the gender is character instead of string.
your name, your gender
jane doe, f
Sam jones, z
Use a switch statement to print out the name and gender. Male should be printed instead of a M, and female instead of f.
Your default should catch and print out the z gender. You should also handle upper and lower case.
4. Enter your first name, sex as a single character, IQ as an integer, weight as an integer, height in inches as an integer.
Your output should be:
If weight> 220, and height is greater than 70, and sex is male, and IQ is less than 100, then print out you should be a football player.
If sex is female, and IQ is > 120, print out you should be a Doctor.
If sex is male and Height is over 84, print out you should be a basketball player.
if sex is female and IQ is less then 80, then print out you should be a house cleaner.
If IQ is less than 120, and weight is less than 100, and height is less than 60, print out you should be a horse jockey.
Please note, that this is not a homework site.
We won't do your homework for you.
The purpose of homework is that you learn by doing.
However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.
We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again.