Problem Solving with C++ (10th Edition)
Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 13, Problem 5PP

A harder version of Programming Project 4 would be to write a class named List, similar to Project 4, but with all the following member functions:

■    Default constructor, List();

■    double List::front();f which returns the first item in the list

■    double List::back();, which returns the last item in the list

■    double List::current();t which returns the “current" item

■    void List::advance();t which advances the item that current() returns

■    void List::reset(); to make current() return the first item in the list

■    void List::insert(double afterMe, double insertMe);, which inserts insertMe into the list after afterMe and increments the private: variable count.

■    int size();which returns the number of items in the list

■    friend istream& operator <<(istream& ins, double writeMe);

 The private data members should include the following:

  node* head;

  node* current;

  int count;

 and possibly one more pointer.

 You will need the following struct (outside the list class) for the linked list nodes:

  struct node

  {

  double item;

  node *next;

  };

 Incremental development is essential to all projects of any size, and this is no exception. Write the definition for the List class, but do not implement any members yet. Place this class definition in a file list.h. Then #include “list.h” in a file that contains int main(){}.Compile your file. This will find syntax errors and many typographical errors that would cause untold difficulty if you attempted to implement members without this check. Then you should implement and compile one member at a time, until you have enough to write test code in your main function.

Blurred answer
Students have asked these similar questions
Activity - Abstract Class An English teacher wants to find assessment mark of all the students in his course. Write a java program to find assessment mark of the students using following instructions. Save the project/file as StudentAbstract. A) Abstract Class name: Assessment Abstract Member Method: - to calculate and return total score totalScore() B) Class name: English extends Assessment Member variables: QuizMark, PracticeTest, ListeningMark Member Method : - Constructor to initialize member variables - to calculate and return total score totalScore QuizMark + PracticeTest*0.25 + %3D ListeningMark/2 C) Controlling class : StudentAbstract - To create an object of English class - To print totalScore of the English
please answer with proper explanation and step by step solution. Question: Program in python:   Design a simple class called Dealership, that has two functions: buyCar(Car a) and sellCar(Car a). buyCar(Car a): Adds the car to the list of cars already in the dealership. sellCar(Car a): Removes the car from the list of cars already in the dealership. Note: Implementation of the Car class is not important for this question
Object oriented programming C++ Use Classes  Write a C++ program in which each flight is required to have a date of departure, a time of departure, a date of arrival and a time of arrival. Furthermore, each flight has a unique flight ID and the information whether the flight is direct or not.Create a C++ class to model a flight. (Note: Make separate classes for Date and Time and use composition).add two integer data members to the Flight class, one to store the total number of seats in the flight and the other to store the number of seats that have been reserved. Provide all standard functions in each of the Date, Time and Flight classes (Constructors, set/get methods and display methods etc.).Add a member function delayFlight(int) in the Flight class to delay the flight by the number of minutes pass as input to this function. (For simplicity, assume that delaying a flight will not change the Date). Add a member function reserveSeat(int) which reserves the number of seats passed as…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
What is Abstract Data Types(ADT) in Data Structures ? | with Example; Author: Simple Snippets;https://www.youtube.com/watch?v=n0e27Cpc88E;License: Standard YouTube License, CC-BY