Category: Computer science and IT assignments

Weighted Directed Graphs C++

Your task is to implement a directed_graph class, where each node/edge has a weight.  (Please use adjacency matrix)

The class should offer a reasonably effective suite of operations. Some (but not all) of basic operations are:

Adding and removing nodes and edges (with weights);

Depth-first and breadth-first traversals;

Computing a tree rooted by the given vertex (the tree may not contain all vertices of the graph);

Pre-order, in-order, and post-order traversals of the tree;

Python Project – Turtle Graphics

Hey! I need to create a Python project with Turtle Graphics. Here are the instructions from my teacher: The word project represents a unique product. The students would, with the use of the Turtle Graphics, for a project task create games (criss cross, memory, chess…). If you decide to do a drawing, it should be a complex one (one student made a drawing of a flag and a coat of arms), and also it would be good that there is a interaction and, depending on what the user of the program inputs, an assignment is done. While creating a project task you should also create documentation that includes the description of the program and commands that you use. My advice is that you write the documentation parallel with the program (write a part of the program that does a part of the project task and then decribe it). It would also be good to include some of the curriculum that we did in school: files, dictionaries, sets. Of course, the focus is on Turtle Graphics.

C# Project

Project :
Your project must:
Have Graphical user interface.
Demonstrate your understanding of classs, objects and other C# features.

Topics (LOs):
1. Implement software designs in an object-oriented programming language
2. Analyse relationship between algorithms and programming, and determine their efficiency
3. Implement most commonly used abstract data types and data structures used in software development
4. Apply prototyping techniques
5. Apply effective problem-solving strategies to foster programming skills.

Select ONE of the following:
A simple management system such as:
School Management System.
Flight Reservation System.
Appointment Booking System.
Inventory Management System.
Supply Chain Management System

Indicative Marking Schedule:
Problem decomposition and design of classes, thereby code (OO) : 15 marks
Use of C# features taught in this course : 25 marks
GUI (Graphical user Interface) : 35 marks
Complete program (executable) : 15 marks
Impression (coding style, workload, presentation) : 10 marks

What to hand in?
The project solution file, source code and executable in electronic format.
All design documentation. (Requirement specification, CRC Cards, or Class diagram).
A readme file: Outlining how your program should be used (Compile and Run). Limitations if any.

Banking system

Multiple Credit Card Management Application (MCCMA) is an application system that is made
with the intent to help multiple credit card owners manage and keep track of their respective credit
card spending. The main goal of this application is to serve as a financial-aid mobile application
for users who hold multiple credit cards. The scope of the application as specified by the client
and project owner is that the project will deliver an application that allows user to manage their
financial accounts, record their day-to-day spending transaction activities and able to make
suggestion/recommendation to user for which credit card to use when making transactions. This
application allow user to add credit card entries manually by inputting basic information of each
card into the application which will record information present on the card such as credit card
number, expiry date, credit card type, associated bank and any card-related details. Users are
expected to input further information such as the monthly payment due dates of each card
manually. Besides, this application allows user to keep track of payment due dates as well. In
summary, the primary features of the application are as below:
The ability to manage credit card, debit card (saving accounts) and normal accounts.
The ability to record day-to-day spending transactions in the form of expenses (spending),
income (earnings) and transfer (movement of funds between accounts).
The ability to provide suggestion for which credit card to use for the purchase when the
user inputs a spending entry into the application based upon the credit card limit, its
interest rate and reward

Java

Only the value of the card counts (7 <8 <9 <10 <Jack <Queen <King <Ace), the color (clubs, spades, hearts, diamonds) is not relevant. The deck of cards is shuffled and the cards are distributed alternately to the players. Each player now has her own pile face down in front of her.
In each round, both players take the top card and place it face up in front of them. If the value of the card is the same, both players take the next card from their own face down pile, turn it over and place it on their face up pile. This is repeated until the two cards face up have a different value. (This is usually the case with the first pair of cards.) Then the player who had the card with the higher value takes the other player’s face-up pile, places it on top of her face-up pile, turns the pack over and shoves it under her face-down pile, see Figure 1. Then the next round begins.
As soon as one player has no cards face down during the draw or at the end of a round, the other player is the winner of the game. If both players have no cards face down during the draw (unlikely case), the game ends indecisively.
This programming task is about simulating the gameplay round by round. First consider the class Card, which can represent a playing card of the Skat game. The class implements the Comparable interface.
This programming task is about simulating the gameplay round by round. First consider the class Card, which can represent a playing card of the Skat game. The class implements the Comparable interface. For two objects card1 and card2 of type Card, “card1.compareTo (card2)”
a negative number if the card card1 has a lower value than the card card2, a positive number if it has a higher value and 0 if the cards have the same value, i.e. only in color (clubs, spades , Heart, diamonds).
A card is created by calling the constructor “public card (int id)” with an input argument id between 0 and 31. The specific assignment of id to card is not relevant to the task, but can be output by executing Card’s main () method if you are interested.
The gameplay is simulated in the class Bettelmann. The structure deque (double-ended queue) is used for the hidden card stack closedPile1 and closedPile2 (in contrast to the term card stack). This data structure can be used both as a stack (e.g. with the methods addLast () and pollLast ()) and as a queue (e.g. with the methods addLast () and pollFirst ()). The reason for using Deque is that both functionalities are required here. When the cards are distributed, the cards are placed on the face down piles. The last cards dealt are drawn first (last-in first-out). The cards won in a round will be pushed under the stack and new cards will be removed from above, i.e. first-in first-out.
The description of the individual methods can be found in the following API and the Javadoc comments in the class. Note that the term deck of cards has no relation to the data structure called stack.

4.1
Inspect the distributeCards (Stack <Card> deck) method
The method distributes the cards handed over to the players’ face-down piles. The cards are taken from the stack one by one and alternately placed face down, so that the last cards dealt are drawn first. The method should first empty the hidden stacks. It should also work for any input, even if deck only contains part of an entire deck of cards.

4.2 Methode playRound() implementieren
Here you should realize a round (see above under game rules). Think about which data structure best suits the stack or queue for the open deck of cards that are formed (and collected at the end) during a round. You can also use Deque with the appropriate methods, but one of the structures stack or queue is also sufficient.

At suitable moments in a round (such as before pulling), make sure that there is something on the different stacks. Even if a tie is considered unlikely, as explained above, you should of course consider the case in your implementation. The method must also set the object variable winner when the game ends on a round. This is the case if at least one of the face-down piles is empty during the draw in a round or at the end of a round.
Hints:
There are initial positions that lead to infinite game sequences. Such cases are not tested in the tests. So you don’t need to be considered.

High Level Assembly (HLA)

PROGRAM 10: Angle Conversion
Believed to have originated in France, a gradian is a unit of measure of an angle that is equivalent to 1/400th of a turn or 9/10th of a degree.  The formula for this conversion solving for Gradian is:

    Gradian = 400 * turn                    or            Gradian = 1.111 * degree

Prompt the user for a value and displays the Gradian value you calculate, if the original value was a degree or a turn.  A sample program dialogue is shown below.

What’s your number: 10.0
Assuming you entered a turn amount, here’s your Gradian: 4000.000
Assuming you entered a degree amount, here’s your Gradian: 11.110

What’s your number: 15.12
Assuming you entered a turn amount, here’s your Gradian: 6048.000
Assuming you entered a degree amount, here’s your Gradian: 16.798

PROGRAM 11: Quadratic Equation
Write an HLA Assembly language program that factors an equation of the form  ax2 + bx + c = 0 by using the quadratic equation.  The formula you need to calculate is shown below:.
quadratic.jpg
Your program should prompt for the values a, b and c, each which are to be real32 values.  A sample program dialogue is shown below.

(Note: Please assume that b2 – 4 a c (what is referred to as the “discriminant”) will always be positive so that you do not need to worry about any imaginary roots.)

Gimme a value for a: 1
Gimme a value for b: 3
Gimme a value for c: -4
The solutions are x = -4.000 and x = 1.000

Gimme a value for a: 2
Gimme a value for b: -4
Gimme a value for c: -3
The solutions are x = -0.580 and x = 2.580

MVC

One class, one file. Don’t create multiple classes in the same .java file
Don’t use static variables and methods
Encapsulation: make sure you protect your class variables and provide access to them through get and set methods
all the classes are required to have a constructor that receives all the attributes as parameters and update the attributes accordingly
Follow Horstmann’s Java Language Coding Guidelines
Organized in packages (MVC – Model – View Controller)

The Netbeans Project
You are required to use this NetBeans starter project.

This assignment focus on using the MVC architecture. The main components are the three packages, Model, View and Controller. From the lesson you know that

Functionality
The main objective is to make View display the information about the 5 Person objects. These 5 objects are created in Model in the method loadData( ). Controller will retrieve the data from Model using the method getData(int n) and pass it to View. View will use the method basicDisplay(String s) to display data from each object with the following result:

Controller will try also to get data from an inexistent object (n = 6) and will receive an error message. It will pass the error message to view to be displayed.

You will need to work on Model, Controller, and View adding methods and statements to achieve the assignment objectives.

The classes
App
it has the main method which is the method that Java looks for and runs to start any application
it creates 3 objects, one of the Model class, one of the View class and one of the Controller class.
When it creates Controller, it passes the two other objects as input parameters so that Controller has access to Model and View.

Controller
will retrieve data from Model using the model object to call the method getData (int n)
n = 1 will return the first Person, n =2 the second Person and so on.
after calling all the 5 objects, Controller will try to call a 6th object and should get a string with a error message.
will pass the data from each Person at a time to View, which will display it
the two operations above will work best if Model and View have methods that help with that.
You are writing these methods
For instance, controller might look like this:

Model
it is already given in the starter project although you will need to add some functionality
it needs a method, loadData( ), to load the data, i.e., initialize the 5 Person objects
it needs a method, getData(int n), which returns data about a specific Person (you will write this method or a similar one)
it returns the result of toString for a Person object (from 1 to 5)
any other value of n should return the message “invalid input parameter”
View
In this assignment, it is a very simple class (it will get more complex quickly in the next two assignments)
it just needs to display the text data that it will receive from Controller
It needs a method, basicDisplay (String s), to do this
Person
it is the same as the last assignment, no changes.

R Homework

The vector `problem.1.data` contains numeric data.

Construct a stipchart of the values in `problem.1.data`. Do you see any evidence of any outliers?

**Solution**

Repair this outlier.

* First, report the location of the outlier.

* Next, convert the value to `NA`.

* Finally, display the value of the vector at this location, and show that it has the value `NA`.

**Solution**

Construct a stripchart of the repaired version of `problem.1.data`. Do you see any indication of a -9 being used to represent a missing value?

**Solution**

It’s not best practice to represent a missing value using the value -9, so we need to repair this.

* First, report the location of the element with -9.

* Next, convert the value to `NA`.

* Finally, display the value of the vector at this location, and show that it has the value `NA`.

**Solution**

Construct a stripchart of the repaired version of `problem.1.data`. Do you see any indication of an extreme outlier (i.e. 99999) or a -9 being used to represent a missing value?

**Solution**

R Programing Homework

Construct a stipchart of the values in `problem.1.data`. Do you see any evidence of any outliers?
Repair this outlier.
    First, report the location of the outlier.
    Next, convert the value to `NA`.
    Finally, display the value of the vector at this location, and show that it has the value `NA`.
Construct a stripchart of the repaired version of `problem.1.data`. Do you see any indication of a -9 being used to represent a missing value?
Directly display all the levels of this factor variable.

Objects and Classes

Use Netbeans
One class, one file. Don’t create multiple classes in the same .java file
Don’t use static variables and methods
Encapsulation: make sure you protect your class variables and provide access to them through get and set methods
all the classes are required to have a constructor that receives all the attributes as parameters and updates the attributes accordingly
all the classes are required to have an “empty” constructor that receives no parameters but updates all the attributes as needed
Follow Horstmann’s Java Language Coding Guidelines
Organized in packages (MVC – Model – View Controller)

Create a NetBeans project with
<default package>
App.java
Person.java
Functionality
The application App creates 5 Person objects
using the data below
name=Marcus Allen, weight=200, hometown=Upper Marlboro, Md., highSchool=Dr. Henry A. Wise, Jr.
name=Kyle Alston, weight=180, hometown=Robbinsville, N.J., highSchool=Robbinsville
name=Troy Apke, weight=220, hometown=Mt. Lebanon, Pa., highSchool=Mount Lebanon
name=Matthew Baney, weight=225, hometown=State College, Pa., highSchool=State College
name=Saquon Barkley, weight=222, hometown=Coplay, Pa., highSchool=Whitehall

The classes

App
it has the main method which is the method that Java looks for and runs to start any application
it creates creates 5 Person objects
it displays information about each object using the toString() method

Person
uses encapsulation
private attributes
a get and a set method for each attribute
has the following attributes
String name;
int weight;
String hometown;
String highSchool;
has two constructors
one with no parameters
one with all the parameters (one for each attribute)
a toString( ) method

Output
The display information will look like:

Person{name=Marcus Allen, weight=200, hometown=Upper Marlboro, Md., highSchool=Dr. Henry A. Wise, Jr.}
Person{name=Kyle Alston, weight=180, hometown=Robbinsville, N.J., highSchool=Robbinsville}
Person{name=Troy Apke, weight=220, hometown=Mt. Lebanon, Pa., highSchool=Mount Lebanon}
Person{name=Matthew Baney, weight=225, hometown=State College, Pa., highSchool=State College}
Person{name=Saquon Barkley, weight=222, hometown=Coplay, Pa., highSchool=Whitehall}