Questions of c programming

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

Question 1: Write a program in C++ to ask the user to input a set of characters, one at a time separated by the carriage return (Enter). Each character, as well as, its corresponding ASCII value should be stored in a linked list node. This means that each node in the linked list should have 3 parts; (1) char that stores the input of the user, (2) int that stores the ASCII value of the character and (3), a pointer to its successor node. When the user inputs the character 0 (zero), the program should break the loop, prints each character with its ASCII value on a separate line, then exits. You can implement the node as struct or class. Please note that the ASCII code of any character can be retrieved by casting its integer value.

Question 2: Consider the following requirements:

a. Class Vehicle
? Variables
o weight of type float, initial value is zero
? Functions
o print() abstract function of type void
b. class Truck inherits from Vehicle
The class Truck is not abstract
c. class Engine
? Functions
o start() of type void. It should print "engine started"
o stop() of type void. It should print "engine stopped"
d. class Tire
? Variables
o pressure of type integer, initial value is 30
? Functions
o inflate() of type integer that takes one integer argument called psi. This function will
add the value of psi to pressure and then it returns the new pressure of the tire
e. class Window
? Functions
o rollup() of type void. It should print "window is up"
o rolldown() of type void. It should print "window is down"
f. class Door
? Variables
o window of type Window
? Functions
o open() of type void. It should print "door is open"
o close() of type void. It should print "door is close"
g. class Car inherits from Vehicle
? Variables
o engine of type Engine
o tire, an array of 4 tires, of type Tire
o left of type Door

Write a program in C++ to implement the above requirements.

Reference no: EM13725651

Questions Cloud

Rate of technological change and global market pressures : Given the rate of technological change and global market pressures, there is considerable change and uncertainty in many organizations. Organizational value is determined more by knowledge (intellectual capital) rather than the traditional factor..
Analysis of first-income earners in the sw and ne : The F-statistic is calculated as approximately - Which of the following represents the alternative hypothesis for this scenario - Analysis of first-income earners in the SW and NE.
Analyze and plan for a social system : To develop your ability to analyze and plan for a social system in a way that integrates key concepts from the course. You will write a strategic analysis of/plan for CVS Health
Construct performance standards for a job : The Objective of this Discussion Board is to Construct Performance Standards for a Job, Select Methods of Performance Appraisal, and Develop Appropriate Training for a given need.
Questions of c programming : Write a program in C++ to ask the user to input a set of characters, one at a time separated by the carriage return (Enter). Each character, as well as, its corresponding ASCII value should be stored in a linked list node.
How did the idea of social darwinism fuel europeans : How did the idea of Social Darwinism fuel Europeans to see themselves as morally superior to those they ruled? Describe the purpose of the paper and conclusion.
Important goals of union ethics training : In a 1 - 2 page paper, identify a minimum of three of the most important goals of union ethics training. In your paper, explain why these goals are important and how they will affect the effectiveness of unions. Ensure that your paper is in APA fo..
Eliminating unethical behavior in collective bargaining : Write a two-page paper in which you will incorporate program ideas for eliminating unethical behavior in collective bargaining. Include a minimum of two programs.
Marketing for health care - personal sales process : Marketing for Health Care - Personal Sales Process, Ethics, and Distribution, Public Relations Interview: Conduct an interview with a public relations administrator at a hospital or health care related facility

Reviews

Write a Review

 

C/C++ Programming Questions & Answers

  How the function delete can be implemented for arrays

Explain in details how the function Delete() can be implemented for arrays to function exactly as it would with lists. Use pseudo code to clarify your explanation.

  Prepare a program that uses at least two functions that can

prepare a program that uses at least two functions that can be called from your main. this program is a number game

  Write a marie program

Write a Marie program - Given a numbers in memory, labelled V, reverse its sign - You can halt your program once the Result is determined.

  Prepare a simple game of blackjack using object oriented

prepare a simple game of blackjack using object oriented programming.uml class diagramsyour project must implement the

  Create two arrays with ten random numbers

Determine the largest difference (only subtract corresponding index numbers) between these two arrays. (hint: create a third array with the differences)

  Write a recursive function to draw the pattern

write a program that prompts the user to enter the number of lines in the pattern and uses the recursive function to generate the pattern. For example, specifying 4 as the number of lines generates the above pattern.

  Object-oriented systems is the concept of object

At the heart of all object-oriented systems is the concept of an object. Simply stated, an object is a set of related characteristics and their associated actions.

  How many generations do you want to wait

How many generations do you want to wait? How many jackalopes do you have?

  Determine the position in the x-y plane

Every circle has a center and a radius. Given the radius, we can determine the circle's area and circumference. Given the center, we can determine the position in the x-y plane.

  Individual genes are substrings of a genome

Individual genes are substrings of a genome delineated by 3-element start and stop codons. Genes begin with the start codon ATG and end with one of the following 3 stop codons: TAG, TAA or TGA. Note that start codons can appear anywhere in the string..

  Create a graphical calculator with buttons that can add

create a graphical calculator with buttons that can add subtract multiply divide - sin cos tan clear and modulus.write

  Write a program to find solutions to the n-queens puzzle

Write a program to find solutions to the n-queens puzzle for various valuesof n. To be specific, test your program for n =4 and n =8.

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