Question
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
- 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.
- Convert nc, ni and m from the command line.
- 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.
- 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.
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started