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

  Determine frequency of each character found in the array

Determines the frequency of each character found in the array - array of pointers to strings and the number of strings as arguments

  Program that prints the statement

Write a program that prints the statement "Learning new topics is Fun!" in a function called writeThoughts that is called by the main function.

  Display the complete fibonacci sequence

Display the complete Fibonacci sequence until u reach a value less than or equal one million - display the count of how many numbers are in that sequence between 1 and 1000000

  Pseudocode for constructing the reverse of an input string

For each position of the string starting at the end working backwards - Append the character at that position to the reverse of the string.

  Program of public class tempconverter

There are numerous opportunities for errors in any program, many times in places that seem too simple to require close attention.

  The big picturethis assignment consists of two separate

the big picturethis assignment consists of two separate programming tasks.1. you will create a linked list module that

  Implement the recursive version of the binary search

Write the code to test it out on a sample input. Compare its complexity with the iterative version found in the text book.

  Write a c program that calculate the gross pay of employee

Write a C program that will calculate the gross pay of a set of employees. For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours as shown below.

  Amanda and tyler opened a business

Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylinderical containers. The shipping charges depend on the amount of liquid in the container. (For simplicity, you may assume that the con..

  Create a function that returns true

Create a function that returns true if the input is a numeric row vector and false otherwise - single input which may be any data class.

  One or more consecutive white spaces is a delimiter

Write a function which will determine how many words are in a given string. assume that one or more consecutive white spaces is a delimiter between words.

  Design and implement a library system that does the

design and implement a library system that does the following ? takes details of a studentlibrary users first name last

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