Write a program using functions with parameters

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

Q1) Write a program using functions with parameters and return value with following requirements.

Ask the user to enter two numbers(If you want to add extra functionality you can provide validations.)
Ask the user to enter a choice.
If the user enters + then the function to add the numbers should be called and the numbers should be added.
If the user enters - then the function to subtract the numbers should be called and the numbers should be subtracted.
If the user enters * then the function to multiply the numbers should be called and the numbers should be multiplied.
If the user enters / then the function to divide the numbers should be called and the numbers should be divided(quotient will be calculated).

Q2) Taking the (in-module-example of the car, create a new Bike Class and include one or more additional variables for the speed of the bike. Include mutator and accessor methods for the bike's speed and use them in the start(), accelerate(), brake() and stop() methods to extend their functionality.When the bike starts, initialise its speed to 0. Allow the accelerator method to increase the speed by an increment and the brake method to decrement the speed. Print the current speed to the screen

Race time:take the same example and separate the class into a header file. Write another program that instantiates two bike objects,both of different models (if you don't know bikes, look up examples for brands of bikes). In your code, start each bike and then accelerate each bike at different rates. Do this in a loop for each bike and then reverse the rates for braking till one bike comes to a complete stop.Print the name of the bike that comes to a complete stop first and declare the other bike the winner.

Reference no: EM132407978

Questions Cloud

Which of the six general environmental forces influenced : Q1. How does UPS's approach toward sustainability impact the triple bottom line? Be specific.
Phases of emergency management and five national framwoerks : What are the differences, similarities, and/or none between the four (4) phases of Emergency Management and the five (5) National Frameworks
What are the key themes of leadership competencies : What are the key themes of leadership competencies? What are the key themes of Global leadership competencies?
Benefits the company to cover these drugs : Although the cost of cancer drugs is large, it benefits the company to cover these drugs, as the patient is more likely to stay with them as a provider
Write a program using functions with parameters : Write a program using functions with parameters and return value and increment and the brake method to decrement the speed.
Evaluate programs plans-procedures and capabilities : What are three types of exercises that can be used to evaluate programs plans, procedures and capabilities?
Business or personal setting : Have you experienced a time where you questioned an organizations ethics whether in a business or personal setting? Please describe.
Company with a forward integration strategy : Think of two companies, one company with a forward integration strategy, and a second company with a backward integration strategy.
Discuss the benefits and risks of keeping business functions : Discuss the benefits and risks of keeping business functions in house verses outsourcing to a foreign country.

Reviews

len2407978

11/26/2019 9:52:02 PM

Hi can you please do my one program o c++ I sent you one file there is 2 program I need just 2nd program for submission..I need with 4 hours . please.Q1- to be done as in class exam - 4 Marks Q2: You can submit by Tuesday 26th Nov -4 marks Thank you

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