How cool ninjas and how they would like to become a ninja

Assignment Help Computer Engineering
Reference no: EM132154793

(USE ONLY BASIC C LANGUAGE)

Objectives

1. To reinforce basic programming constructs

2. To learn how to use for loops

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: Ninja Tactics Now that your friend is one the path to becoming a ninja, it's time for them to learn about some of the sneaky tactics that ninjas employ.

This particular ninja academy prefer non-lethal tactics whenever possible. Apprentice ninjas will need to learn about smoke bombs, sleeping drugs, and first aid.

The best way to learn about these things is by examining their ingredients. Your mentor has tasked you with going to several different stores to place orders. This program should ask for the total number of shops that will be visited.

At each shop, ask for the number of ingredients that need to be purchases. For each ingredient, ask for the price. Keep track of the total for the order so that you can write it down before leaving the shop. This program should also track with order was the cheapest and which shop the cheapest order was at. This will help your mentor decide who to keep doing business with!

Input Specification

1. The number of shops will be a positive integer.

2. The number of ingredients will be a positive integer.

3. The cost for each ingredient will be a positive real number.

Output Specification

Output the cost at each shop to two decimal places.

Your total at #Y is $X.XX.

At the end of the program, print the cheapest order.

Your cheapest order was at shop #Y and cost $X.XX.

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 2 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 clarity's sake.)

Sample Run

How many shops will you be visiting? 3

You are at shop #1. How many ingredients do you need at shop #1? 2

How much is ingredient #1? 3.5

How much is ingredient #2? 10

Your total at shop #1 is $13.50.

You are at shop #2. How many ingredients do you need at shop #2? 3

How much is ingredient #1? 2.75

How much is ingredient #2? 3

How much is ingredient #3? 1.25

Your total at shop #2 is $7.00.

You are at shop #3. How many ingredients do you need at shop #3? 2

How much is ingredient #1? 4

How much is ingredient #2? 5

Your total at shop #3 is $9.00.

Your cheapest order was at shop #2 and cost $7.00.

Reference no: EM132154793

Questions Cloud

How many passes would be required to complete the sort : If you were to use a bubble sort to re-sort these elements into descending order, how many passes would be required to complete the sort?
Design a program should contain a class : If the user indicates that they are not a member, they should be prompted to enter their information for registration.
How digital platforms used to increase market penetration : MIK 304 & MEB 301 E-MARKETING STRATEGIES ASSIGNMENT - Give details on how digital platforms can be used to increase market penetration
Write a function called coffee that takes no input variables : Create an M-file named coffee.m and write a function called coffee that takes no input variables and returns no output value.
How cool ninjas and how they would like to become a ninja : Ninja Tactics Now that your friend is one the path to becoming a ninja, it's time for them to learn about some of the sneaky tactics that ninjas employ.
Write a method to remove all of the elements in list : Write a method to remove all of the elements in list of Integers that are less than some target value.
Write a program that generates a sequence of numbers : Uppercase Conversion Write a program that converts a string containing up to 256 lowercase characters to uppercase.
Would the greedy algorithm remain optimal for giving change : TV anchor Greta Van Susteren suggested that we should leave Jackson on the $20 bill and instead create a new $25 bill featuring Tubman.
What is meant by the term chain of custody : Explain the difference between Centralized Processing, De-centralized processing, and Distributed processing?

Reviews

Write a Review

Computer Engineering Questions & Answers

  How many memory cycles are needed to execute given program

Answer Problem assuming that the memory of each of the machines is organized as eight bits/word and only one memory word can be accessed per memory cycle.

  Identify three successful and well-used scoring functions

Identify three successful and well-used scoring functions in areas of personal interest to you. For each, explain what makes it a good scoring function.

  Explore how video games are being used by medical community

For this writing assignment, you will explore how video games are being used by the medical community. Video games (both online and apps) are a source of entertainment for individuals and groups of people.

  Describe how moving the cutoff up or down would affect

Describe how moving the cutoff up or down would affect the classification error rate for records that are truly fraudulent.

  What the internet has to offer to educate people in this

project portfolio management methoda project portfolio management is to ensure that projects are aligned with strategic

  Identify threats and vulnerabilities in an it infrastructure

To complete Lab 1, please access and complete the lab activities under Topic 1: Identifying Threats and Vulnerabilities in an IT Infrastructure.

  Obtain the truth table of the functions

Obtain the truth table of the functions, and express each function in sum-of-min-terms and product-of-maxterms forms:

  Diffe-hellman algorithm

Alice and Bob use the Diffe-Hellman to agree on a secret key. They select the prime p = 11, and a primitive root mod 11 g = 2.

  Write a program that displays all integers

Write a program that displays all integers between low and high that are the sum of the cube of their digits.

  Should colleges have the right to block students access

Many colleges block access to Web sites that enable students to participate in potentially illegal activities such as downloading music, gambling.

  Discuss primary advantages of gui over a textual interface

Discuss the primary advantages of GUI over a textual (command-line) interface in Linux system administration. Describe two (2) Fedora/Red Hat Enterprise Linux (RHEL) GUI desktop managers and explain how they generally function.

  Identify improvements and propose the system to-be

New System development requires first to understand the system AS-IS, identify improvements, and propose the system TO-BE.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd