Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write in C Input data txt: output data txt Objectives 1. To reinforce the use of loops. 2. To learn how to read information from
Write in C
Input data txt:
output data txt
Objectives 1. To reinforce the use of loops. 2. To learn how to read information from files. Introduction: Ninja Academy Ninjas are awesome! Your friend has not stopped talking about how cool ninjas and how they would like to become a ninja. To amuse your friend, you have decided to create a series of programs about ninjas. Problem: Shurikenjutsu Competition (shurikenjutsu.c) Your friend is competing in an academy wide competition where students show off their shurikenjutsu (throwing weapon techniques) skills. The competition is similar to darts where each student throws a pointed object at a target. There are scores based on how close to the center of the target the object lands. Students compete one-on-one in a series of sets. Each set has three throws for each student. The student with the highest accumulated score wins the round and may advance to the next one. In this program, you will examine a file of scores from the competition. Ask the user for the name of this file. The first value of the file will be the number of sets completed. For each set print the total score for each student. At the end of all the sets, print the accumulated scores and announce who will advance to the next round. Arrays are not required except for the name of the input file. Input Specification 1. The file name will be a string less than 50 characters in length Input File Specification The first line of the input file will contain a single integer n (55ns 10000), denoting the number of sets for which there is data in the file. Each set will contain 6 integers, 3 throws for student 1 and 3 throws for student 2. Each of these numbers will be an integer in between 0 and 20, inclusive. Output Specification Output to the screen. Show the user the result of each set. Then, print the final accumulated scores and announce who will be advancing. In the event of a tie, only print the final accumulated scores. Set #x Student 1: Y points Student 2: Z points Final Scores Student 1: Y points Student 2: Z points Student A will be advancing to the next round! 3 19 16 00 mm 0 0 0 0 0 15 1 14 2 1 7 9 5 Set #1 Student 1: 25 points Student 2: 33 points Set #2 Student 1: 30 points Student 2: 26 points Set #3 Student 1: 24 points Student 2: 17 points Final Scores Student 1: 79 points Student 2: 76 points Student 1 will be advancing to the next roundStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started