Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment #5 Introduction to C Programming COP 3223 Objectives 1. To reinforce the use of loops. 2. To learn how to read information from files.

Assignment #5 Introduction to C Programming COP 3223 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 name of the file will be a string ending in .txt. Input File Specification The file will contain integers. The first integer, n, will be 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! Output Sample Below is a sample output of running the program. Note that this sample is NOT a comprehensive test. You should test your program with different data than is shown here based on the specifications given above. In the sample run below, for clarity and ease of reading, the user input is given in italics while the program output is in bold. (Note: When you actually run your program no bold or italics should appear at all. These are simply used in this description for claritys sake.) Input File (input.txt): 3 3 3 19 16 8 9 15 1 14 12 13 1 7 8 9 6 6 5 Corresponding Output: What is the name of the input file? input.txt 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 round! Deliverables One source files shurikenjutsu.c is to be submitted over WebCourses. Restrictions Although you may use other compilers, your program must compile and run using Code::Blocks. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Also, make sure you include comments throughout your code describing the major steps in solving the problem. Grading Details Your programs will be graded upon the following criteria: 1) Your correctness 2) Your programming style and use of white space. Even if you have a plan and your program works perfectly, if your programming style is poor or your use of white space is poor, you could get 10% or 15% deducted from your grade. 3) Compatibility You must submit C source files that can be compiled and executed in a standard C Development Environment. If your program does not compile, you will get a sizable deduction from your grade.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions