Write a program that displays the cubes of the numbers

Assignment Help C/C++ Programming
Reference no: EM13338779

Repetition Statements

Write a program that displays the cubes of the numbers from 1 to 10. Recall that the cubes of a number is just the number multiplied by itself and then by itself again. Demonstrate your knowledge of both looping structures by writing two procedures to do this. One procedure should be called, cubeFor and the other should be called, cubeDoWhile. Each procedure should take no arguments and return no values. Inside the procedure, simply display a message telling what kind of loop it is using and then use the appropriate loop to display the number, followed by its cubed value.

When you finish writing these two procedures, write a main procedure that will call both cubeFor and cubeDoWhile to show that they work.
Although the output from your program is not required to look this way, it might look something like:

The cubes using a for statement are:
1 1
2 8
3 27
4 64
5 125
6 216
7 343
8 512
9 729
10 1000

The cubes using a do...while statement are:
1 1
2 8
3 27
4 64
5 125
6 216
7 343
8 512
9 729
10 1000

Reference no: EM13338779

Questions Cloud

Design a wide area network : Design a wide area network (WAN) between offices that includes appropriate math calculations to meet the bandwidth.
Find the electric field as a function of r outside sphere : An aluminum wire has a length of 20m and adiameter of 0.0025in. It is connected to a 9.35V battery. The resistivity of aluminium is 2.65x10^-8(ohm(m))a).
Analyze richardson message from multiple perspectives : Analyze Richardson's message from multiple perspectives, focusing on word choice and content
Determine the total force the person must apply : A person is pushing a uniformly-loaded 21.65 kg wheelbarrow along a plank that makes an angle ? = 27.0° with the horizontal. What is the total force the person must apply
Write a program that displays the cubes of the numbers : Write a program that displays the cubes of the numbers from 1 to 10. Recall that the cubes of a number is just the number multiplied by itself and then by itself again.
Find the magnetic vector potential inside and outside a slab : Find the magnetic vector potential inside and outside a slab of thinkness 2a, extending infinitely in x and y directions. Use Coulomb's gauge. J= -J e^-abs(z)/a)
Find the capacitance that satisfies the design criteria : You're designing a speaker, and you want the tweeter to handle almost everything above 1100 Hz, and woofer to handle almost everything below Hz. Find the capacitance that satisfies the design criteria
Write a program to print the permutation : Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation.
Create a non-gui based java application : Create a non-GUI based Java application that calculates weekly pay for an employee. The application should display text that requests the user input the name of the employee.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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