Create your function in c that accepts one input parameter

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

Assignment 1- Create your own Function

Create your own function in C that accepts one input parameter and returns a float number. You decide the theme.

You should provide both your C code and an example call to the C code function. Be sure to provide an overview of what your function is doing.

Provide a screen capture showing the results of testing your code in an online compiler.

Be sure to test your code with several test cases and show your test case table.

Assignment 2-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

A repetition loop can be used to loop through iterations until a negative is entered: while(intValue > 0) (

End For

Test Plan

To verify this program is working properly the input values could be used for testing:

Learning Exercises for you to complete

1. Using the Square and Cube functions as models, Create an application that includes a function named "Shrink" that would take an Integer and return the Integer divided by 2? (Hint: your returned value should probably be a double type.) Support your experimentation with screen captures of executing the new code.

2. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the code you created after step 1.

3. What would happen if you removed the following code from our design? If intValue > 0

Support your argument with screen captures of executing the new code.

4. Modify the original code and add an additional function of your choice. The function should be unique and something you created for this assignment. Support your experimentation with screen captures of executing the new code. Prepare a test table with at least 3 distinct test cases listing input and expected output for your unique function.

Attachment:- Hands-On_Lab.pdf

Reference no: EM131232544

Questions Cloud

What are the objectives of macroeconomic policy : What are the objectives of macroeconomic policy? Find the targets for each objective by Bank Negara Malaysia (BNM).
How many thousands of pounds of meat : a. How many thousands of pounds of meat would you recommend that the government purchase to keep the price at $4 per pound?
Personnel decision—different jobs : Discuss what sources of information would be most beneficial for the following: Personnel decision—different jobs
Find the mass of methane and the heat transfer : Consider a general version of Problem 3.144 with a substance listed in Table A.6. Write a program where the initial temperature and pressure and the final temperature are program inputs.
Create your function in c that accepts one input parameter : Create your own function in C that accepts one input parameter and returns a float number. You decide the theme. Provide a screen capture showing the results of testing your code in an online compiler.
Parenting young children or issues of very young children : Collect two "case problems" related to parenting young children or issues of very young children, found in magazines, newspapers, or on Internet bulletin board.
Determine the final pressure and temperature : Write a program for Problem 3.163, where the initial state, the volume ratio, and the polytropic exponent are input variables. To simplify the formulation, use constant specific heat.
Replacement windows were a necessary improvement : You may think these are too hard, but I know I have 4 of these already, and one (cedar siding) came with my incredibly cheaply built home (the replacement windows were a necessary improvement).
What steps should have been taken to address the issues : Discuss a time when you have been a member of a team that has not performed well. Why was the team not effective? What role did the leader play in the team's inability to perform? What steps should have been taken to address the issues?

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