Calculate square or cube of positive integer input by a user

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

Assignment: Hands-On Lab

Overview

This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, design, and implementation with C code. The example provided uses sequential, repetition, selection statements and two user-defined function.

Program Description

This program will provide options for a user to calculate the square or cube of a positive Integer input by a user. The program will prompt the user to enter an Integer and then prompt the user if they want to calculate the square of the cube of the number. Based on the inputs of the user, the program will output the square of the cube of the positive integer. The program will then print the Integer and square or cube of the integer based on the user's original choice. The program will continue to prompt the user for Integers and their calculation choice until the user enters a negative integer. The square and cube calculations should be calculated using a function.

Analysis

I will use sequential, selection, and repetition programming statements and functions for the cube and square calculations.

I will define three Integer numbers: IntValue, MenuSelect, Results to store the Integer value input by the user, the Menu selection (1 for Square, 2 for Cube) of the user, and the results of the Square or Cube functions.

The Square function will take one Integer as input and return one Integer as the output. The calculation within the Square function is: Results = IntValue * IntValue

For example, if 10 was entered as the IntValue. Results = 10*10 = 100

The Cube function will take one Integer as input and return one Integer as the output. The calculation within the Cube function is: Results = IntValue * IntValue*IntValue

For example, if 10 was entered as the IntValue. Results = 10*10*10 = 1000

Attachment:- Hands-OnLab.pdf

Reference no: EM131674437

Questions Cloud

Identify a current problem in an area of interest : Summarize your review of at least five peer-reviewed journal articles to find a current problem in your topic or area of interest (within individual OB).
The role of the prosecutor in the criminal justice process : What are the major differences between federal court and state court, What is the role of the prosecutor in the criminal justice process
Patient was admitted for evaluation of melena : A 44-year old male patient was admitted for evaluation of melena. He has noticed melena occasionally for the past week.
What automation of the chart analysis process : What automation of the chart analysis process would you expect from Chart Tracking/Deficiency Analysis
Calculate square or cube of positive integer input by a user : Assignment: Hands-On Lab. This program will provide options for a user to calculate the square or cube of a positive Integer input by a user.
How does fitbit use the internet of things : How does fitbit use the internet of things? How does Fitbit use the internet of things?
Explain an important issue in social psychology-aggression : Discuss how each perspective would explain this relationship.Discuss three assumptions that this perspective would make in explaining this relationship.
Objective function in such an environment : What would be the nature of the objective function in such an environment?
Measure the search cost and percentage of solved problems : Generate a large number of 8-puzzle and 8-queens instances and solve them (where possible) by hill climbing (steepest-ascent and first-choice variants).

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