Program in c to ask the user to input a set of characters

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

C++ program

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.

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

Reference no: EM13767181

Questions Cloud

Whats the best approximate age for the site : Deinotherium boszai, Giraffa stillei, Parmularius altidens,Beatragus antiquus, Eurygnathohippus sp., and Kolpochoerus heseloni. What's the best approximate age for the site?
Calculate cost of goods sold : Write a 300- to 400- word paragraph answering the following questions: How would you calculate cost of goods sold?
Describe the stages of the life cycle of the blowfly : Describe the stages of the life cycle of the blowfly? How long is its life cycle (hours/days/weeks/years)? How does temperature and moisture affect the length of the blowfly's life cycle
Explain how the transactions would be entered : Explain how the transactions would be entered into the US balance of payments Macys purchases of $20,000 of wool socks from Australia
Program in c to ask the user to input a set of characters : 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 nod..
Evaluating possible courses of action : A major accounting contribution to the managerial decision-making process in evaluating possible courses of action is to
Why are such offenses not usually listed as victimless crime : Please write in a 1-2 page paper whether or not possession and carrying of firearms, or the illegal purchase of a firearm are "victimless" crimes? Why are such offenses not usually listed as victimless crimes
A cam therapy or modality issue : Discuss whether a license or certification is required to practice this therapy.
Summarize the main legal requirements related to the fmla : Summarize the main legal requirements related to the FMLA in no more than one page. Provide guidelines for employees to follow for requesting leave, including notice requirements, certification, benefits, and returning to work

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program that use classes game-arena-robot and player

Your assignment is to complete this C++ program skeleton to produce a program that implements the described behavior. (We've indicated where you have work to do by comments containing the text TODO;

  Write a function named concatenate

If the function discovers that the number of cells in the large array is not large enough to hold all the numbers to be copied into it, then the function should return 0 to indicate failure.

  Reads from the external file input.txt

Program that reads from the external file input.txt, counts the letters in every word, replaces the word by that number, and then writes the numbers to an external file output.tx

  Need c++ solution to cover the final stage of euro 2012

From Group Fase to elimination fases, it´s not the user who defines teams, because that must be made automatically according to classification in group fase - considering regulations.

  Write a c matrix multiplication program which you can

write a c matrix multiplication program which you can instrument to monitor and measure execution time as a function of

  Write a program using the class as defined

Write a program using` the class as defined below. Put the class definition in a separate header file, and put all the functions' code in a separate Resource file.

  How many times is the copy constructor called

In the subsequent code how many times is the copy constructor called in the given code?

  Calculate compounded monthly interest

So for example if I were to have an initial balance of $1250.00 with an interest rate of %13 paid over the course of 4 months it should come out to $2038.09 total for interest added to the initial balance

  Implement circular linked list in c program

implement circular linked list in c program in the best possible easiest way.

  Create the logic program

Create the logic for a program that accepts input values for the projected cost of a vacation and the number of months until vacation. Pass both values to a method that displays the amount you must save per month to achieve your goal.

  Create if-then statement with single alternative decision

Create the If-Then statement (or a flowchart with a single alternative decision structure) which assigns 20 to  variable y and allots 40 to variable z if variable x is greater that 100.

  What are the sizes in memory of data types

What are the sizes in memory of other data types in C++? I mean, I know that a double is 8 bytes and an int is 4 bytes. What si the size of a Char and a String?

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