Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC212 Assignment3 The following program named myLinkedlist.cpp is related to myNode class and myList class discussed in the course. It uses myList class template to

CSC212 Assignment3

The following program named myLinkedlist.cpp is related to myNode class and myList class discussed in the course. It uses myList class template to create a linked character list and a linked integer list, and then display both lists. Read the program carefully and complete the missing code as indicated by the comments. Compile and test your program using the command lines below before your submission:

c++ -o myLinkedList myLinkedList.cpp

./myLinkedList nc ni m

Where nc is the number of random characters added to the head of the character list, niis the number of random integers appended to the tail of the integer list, and m is the number of elements displayed per line.

In this program, you need to

  1. Include necessary library headers as well as stdio.h and stdlib.h so you can call the atoi(char*) function to convert the command line arguments nc, ni and m in ASCII to integer values.
  2. Convert nc, ni and m from the command line.
  3. Create a random character list clist and add nc number of random characters to head. All characters added must be upper case letters. Display these letters, m characters per line.
  4. Create a random integer list ilist and append ni number of random integers to tail. All random integers appended must be in the range [0, 511]. Display these integers, m integers per line.
  5. Display the linked character list and the linked integer list, m elements per line.

// Student Name

// Student ID

// myLinkedList.cpp

// include necessary library headers and use namespace std here

// implement myNode template class

// implement myList template class

// program entrance

int main(int argc, char *argv[]) {

// convert nc and ni from command line and declare character list clist and integer list ilist

// set random seed

// add nc number of random characters to list head and display them, m characters per line

// append ni number of random integers to list tail and display them, m integers per line

// display clist and ilist, m elements per line

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions