Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. To give students practice at typing in, compiling and running simple programs. 2. To learn how to read in input from the user. 3.

1. To give students practice at typing in, compiling and running simple programs.

2. To learn how to read in input from the user.

3. To learn how to use assignment statements and arithmetic expressions to make calculations

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: Entering the Academy

Everyone knows the first step to becoming a ninja is to find a secret ninja academy that will train you. Most ninja academies are located in the mountains. In this program, we will calculate how much rope your friend needs to scale the mountain with.

You will need to ask the user for the height of the mountain in feet. You can then determine how many skeins of rope they will need. The store sells rope in two different lengths: 100 feet and 10 feet. Determine how many of each type of rope they will need. Print this information to the user.

Input Specification

1. The height will be a positive integer.

Output Specification

Output the number of skeins as a whole number using the format below:

You will need X skeins of 100 feet rope and Y skeins of 10 feet rope!

Output Sample

Below are some sample outputs of running the program. Note that these samples are 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.)

Sample Run #1

How tall is the mountain?

5000

You will need 50 skeins of 100 feet rope and 0 of 10 feet rope!

Sample Run #2

How tall is the mountain?

6512

You will need 65 skeins of 100 feet rope and 2 of 10 feet rope!

Deliverables

One source file ninjarope.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.

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

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

Develop skills for building positive relationships.

Answered: 1 week ago