Difference between a variable and a constant

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

SIT102 Introduction to Programming

Task 1: Hello User

Overview

Now that we have variables, constants, and some basic of proper use of functions from week 2 pre- class resources and class, you should be able to create a program that use these to collect the user's inputs and store the corresponding data in memory with the desired data types. Get started by reading in the users name from the Terminal and echoes back a welcome message. Learn how to work with variables, constants, and functions. Later on, you will extend you knowledge and skills to create your own functions for some different calculations in Hello User 2.

Your Task

To build a program with the features with the given code. The relevant sections of the code are shown in the figure at the following page.

You are recommended to code the syntax by yourself as a practice or get the start up framework to build your program block by block - get the framework from Resource.zip at this OnTrack task. The framework provides you with definitions of read_string() and read_integer(), and a function definition prototype in code comments. Please be noted, the code comments in the given .cpp of resources aim to provide you with all details - it is a good example of "over commented" source code!

If you would like to get more details on function declaration and definition. You could study Unit Site's pre-class resource - Week 3 contents in advance! Week 2 and Week 3 are respectively part 1 and part 2 of topis in Data and Functions.

The functional goals of your program:
1. Ask the user to enter his/her name and age (provided in the figure)
• Output the details of the user's inputs (provided in the figure)

2. Ask the user to enter the bird name, frequency of the named bird in beating its wings, and amplitude of its stroke. Assume the user will only input a whole number for both frequency and amplitude.
• Output the bird name entered by the user and the resultant air speed
For details on airspeed calculation see The Shrouhal Number in Cruising Flight and Estimating theAirspeed Velocity of an Unladen Swallow.

This must demonstrate the creation and use of:
• Local variables for the name, age (provided in the figure)
• Local variables for the frequency of the named bird in beating its wings, amplitude of its stroke, and others as needed. //Hints: Think about the data types in their declarations
• Global constant for the Strouhal number (provided in the figure)
• Function calls for the following:
o To calculate the air speed velocity, with parameters for bird name, frequency and, amplitude from the user inputs, by calling
double calculate_air_speed(int freq, int amp)

Note: Assume the user will only input a whole number for both frequency and amplitude.

o To output the resultant air speed along with the bird name to the terminal.
void output_air_speed(string name, int freq, int amp)

o To read in a string from the user, with a parameter for the message to prompt them with.
string read_string(string prompt)

o To read in an integer from the user, with a parameter for the message to prompt them with.
string read_integer(string prompt)

Make sure to adjust all user inputs to use your read_string, and read_integer functions if applicable.

You may be asked for Discuss to demonstrate your understandings of the weekly topic:
• Explain the difference between a variable and a constant. When would you use each of these?
• Why use constants when the value could just be typed in the code everywhere it is needed?
• What are some of the different types you can use for the values in your variables?

Attachment:- Introduction to Programming.rar

Reference no: EM132949720

Questions Cloud

Five generic competitive strategies and apple inc : The Five Generic Competitive Strategies and Apple Inc. as an example company, describe how you would classify Apple's competitive strategy and why?
What is the percentage return loses : After an analysis of Lion/Bear, Inc., If O'Grady does sell the stock short, what is the percentage return he loses if the price of the stock rises to $12?
Ethical standards of professional conduct : Compare and contrast how our personal values relate to ethical standards of professional conduct. Healthcare setting.
Discuss the training theory and primary tenets : Imagine that you work for a global automobile manufacturer as a lead training and development associate. The head of human resources (HR) has had meetings with
Difference between a variable and a constant : Create a program that use these to collect the user's inputs and store the corresponding data in memory with the desired data types. Get started by reading
What the longer the time to maturity : What the longer the time to maturity? the greater the bond price increase from an increase in interest rates./ the less the bond price increase from an increase
Pg marketing-middle-class adjustment : Tide, Pampers, Bounty, Gillette, Crest, Scope, and Febreze. What do they all have in common? They are just a few of the brands owned by Procter & Gamble (P&G),
Cinnamon case-sales negotiation : You are the owner of Mahek Masala Products Pvt. Ltd., a trading company that deals in the trading and processing of specialized spices from Kerala. Kerala is a
Calculate the employment insurance premium for pay period : An Ontario employee has year-to-date Employment Insurance premiums of $878.72 in 2021. Calculate the Employment Insurance premium for the pay period.

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