Write main method to demonstrate the correct working of each

Assignment Help Python Programming
Reference no: EM132322534

Assignment

1. Write separate programs for the following exercises in Java, Python, or C#. Each file should have your name at the top in comment, with short description of what is implemented in that file. Make sure your files have appropriate names as indicated in each exercise. Programs should write output to the Console and have hard coded input in main.

Note 1: If a program is not in approved programming language (or in different language than previous assignment) or has any syntax error, no points will be awarded for that exercise

Note 2: Submitting wrong files or in the wrong format or corrupted files will not be accepted nor will any re-submission be allowed for any such mistake. It is your responsibility to submit the correct files.

a) DLinkedListADT: Implement doubly linked list ADT using the pseudo code covered in class. The data-type that the ADT should store should be a Student object with the following attributes/members: name (string), id (integer), grade (character). You must have all the operations in the pseudo code with the SAME naming convention and statements. The operations printNextList and printPrevList should only print the student's name.

Any operation that is implemented differently from the one given, will not earn credit. Write test program with main method creating an instance of the DLinkedListADT and calling all the operations to demonstrate they work correctly. You must implement a class called DLinkedListADT for the ADT implementation in one file and a separate TestDLinkedList class for the test in a different file. You also need a third file with an implementation of Student class.

b) ConvertToArray: Implement a method that takes DLinkedListADT instance. The method then allocates an array students[] and copies all elements over from the list to the array. The method prints each element's data on separate line and returns the array to the
caller. The method must check if the list is null/None or empty and throw an exception if it is. Analyze time/space complexity of the method. Write a main method to test the code.

c) ListInsert: Add new linked list operation to DLinkedListADT. The operation is called insertBefore and takes two parameters:  insertBefore(String name, Student student).

Then it finds the first node in the list that matches the name and inserts a new node with student value as the previous node in the list. If the list is null it just adds the new Node and if the name is not found in the list it throws an exception with message that the value is not found. Add test cases to TestDLinkedList class from exercise (a) to demonstrate the code works. Analyze time/space complexity of the new operation.

For example:

Given linked list with student elements that have the following name order {"Joe", "Jane", "John"} when we call insertBefore ("Jane", student) where the student has the values {"Beth", 12345, ‘A'} the updated list will have node elements in the following name order: {"Joe", "Beth", "Jane", "John"}

d) QueueADT: Implement Queue ADT using the DLinkedListADT from previous exercise to store Student objects as elements and to include operations:

QueueADT(int min)

boolean isEmpty()

boolean isFull()

void enQueue(Student item)

Student deQueue()

int size()

You must use the QueueADT pseudo code covered in class and use the given operation names and implementation. You cannot not have any other operations. Write test program with main method to demonstrate the correct working of each operation (use double values for your test data). You must implement a class called QueueADT and separate TestQueue class each in a separate file.

e) StackADT: Implement StackADT using the DLinkedListADT from previous exercise to store Student objects as elements and to include operations:

StackADT(int min)

boolean isEmpty()

boolean isFull()

void push(Student item)

Student pop()

int size()

You must use the pseudo code covered in class and use the given operation names and implementation. You should not have any other operations. Write main method to demonstrate the correct working of each operation in a separate test program (use double values for your test data). You must implement a class called StackADT and TestStack class in a separate file.

f) Stack1: A letter means doing a push operation and an asterisk means doing a pop operation n the below sequence. Give the sequence of letters which are returned by the pop operations when this sequence of operations is performed on an initially empty stack.

AB*CE**F**GH*I**

g) Stack2: Given an empty stack in which the values A, B, C, D, E are pushed on the stack in that order but can be popped at any time, give a sequence of push and pop operations which results in pop()ed order of CEDBFA 2.

Record a video(s) 10-20min long explaining the implementation and solution of each of the above programs to include showing the running program and output. You may have two separate videos if you need more time to explain all exercises. DO NOT create separate videos for each exercise!!!

Attachment:- pseudo code.rar

Reference no: EM132322534

Questions Cloud

Make presentation about third-party logistics provider : Research any Canadian 3PL (third-party logistics provider) and prepare to make a 5-minute presentation about that organization to the class
How influenced do you consider yourself to be : How influenced do you consider yourself to be when it comes to strategic product brand messages? Does your use of social media shape your purchasing decisions?
How does a team supervisor select a strategy : Given that most teams will have a mixture of the two types, which suggestion for for inter-team conflict resolution do you think is the best and why?
Discuss what fraud detection techniques could have used : Find a court case where fraud occurred involving either a cash receipts or cash disbursement scheme (using the KU library/Westlaw).
Write main method to demonstrate the correct working of each : Write separate programs for the following exercises in Java, Python, or C#. Each file should have your name at the top in comment.
Explain what products or services it provides : You have learned that some markets are competitive but that there are also a few markets that are serviced by just one firm. Examples include utility companies.
Discuss the strategic importance of layout decisions : MGT 655 Discussion Assignment - Discuss the strategic importance of layout decisions. How can a particular layout affect a company's strategic goals
Summarize key points and post in the discussions area : Go to the internet and find a news article published within the last three months that discusses perfect competition, summarize key points and post.
Fisherman in new brunswick : Mr. Jones is a snow crab fisherman in New Brunswick and agreed to sell his boat and license to Mr. Doucette - a fisherman resident in PEI.

Reviews

len2322534

6/14/2019 10:16:50 PM

Correctly implements DLinkedListADT class and its operations using pseudo code covered in class to include naming convention and the statements with data-type as Student object Correctly implements the test program TestDLinkedList which calls all operations in separate file to demonstrate correctness of the code Video correctly explains the ADT and test implementation, and shows and explains running program and output

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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