Category: Desktop software development

Music Player Assignment

Smart pointers are required. Basic requirements: Create three classes: Disc.h, Disc.cpp, DiscList.h, DiscList.cpp, Track.h, Track.cpp. Follow the UML for a diagram with how to construct the classes. Main file should implement a menu that looks like this:

(A)dd a new disc.
(R)emove an disc.
(P)rint an disc.
(L)ist discs.
(Q)uit

Assignment due on Tuesday.

Java Development

1 Questions which i have outlined below.

The work coding needs to be completed within the blue J project file i have uploaded below and to the specification that the questions ask it be. A lot of the project is completed already.

QUESTIONS:

This question involves completing a class called WizardController, instrances of which coordinate an exhibition performed by two wizards. The exhibition consists of a series of actions performed by each wizard in turn and repeated a number of times selected by the user. The actions are “fly” and “slither” and these incorporate jumps, making use of methods in Wizard to achieve these.

Wizards are represented by objects of the Wizard class which is provided.

Wizards have an instance variable persona of type Triangle, which enables them to be visible in the Shapes window. They are located in cells. They move from cell to cell horizontally or vertically. Cells have width CELL_SIZE_X and height CELL_SIZE_Y. The persona of a wizard in cell (1,3) for example would have xPos = CELL_SIZE_X and yPos = 3 * CELL_SIZE_Y. They have attributes cellX and cellY which show the current cell X and Y positions they are in.

Wizards remember their starting cell using the instance variables startCellX and startCellY so that they can return to these. startCellX is always 0 but startCellY is initialised using an argument passed to the constructor.

You are provided with a method in Wizard called getPersona(). This is solely so that you can display the wizard. You should not make use of this method in the WizardController class. Doing so would break encapsulation.

Launch BlueJ and open the project TMA03_Q1 which was provided in the zip file containing this TMA, then immediately save it as TMA03_Q1_Sol. This project contains partial implementations of WizardController as well as the Wizard class and before proceeding further, you should open both classes and familiarise yourself with their contents. You do not need to alter the Wizard class and should not attempt to do so.

At different points in this question you will be directed to look at specific parts of the WizardController class. We begin with the methods getNumOfRepeats(), isValidNumOfRepeats() and promptForNumOfRepeats().

A.

The public instance method getNumOfRepeats() takes no arguments and returns an integer between 1 and 3 (inclusive).
getNumOfRepeats() makes use of two helper methods:

promptForNumOfRepeats(), which prompts the user for a number between 1 and 3 and attempts to parse the response as an integer, and
isValidNumOfRepeats(), which checks that the number the user has input is in the correct range 1 to 3 (inclusive).
If the input is out of range the user is prompted again, and the method continues to loop until a number in the required range is entered.

But what if the user makes a mistake and enters something that cannot be parsed as an integer at all? In this case, the parseInt() method will throw a NumberFormatException and the program as it stands will simply stop executing.

To handle this case more gracefully the promptForNumOfRepeats() method can be modified to make use of a try-catch block. If an exception is thrown the catch statement can assign 0 to the number of moves, and since this is outside the range 1 to 3 the user will be prompted to try again. (Of course any integer outside the required range could be used instead of 0 but it seems a natural choice).

Modify the promptForNumOfRepeats() method so that it handles the possible exception in the way described above.

(3 marks)

B.

The WizardController class has the following private instance variables:
Two variables of type Wizard:
wizard1 and wizard2

which represent the wizards performing the moves;

A variable of type int:
numOfRepeats

which holds the number of times the moves are to be repeated;

It also has three int class constants:

MIN_NUM_REPEATS and MAX_NUM_REPEATS
which hold the minimum and maximum number of times the moves can be repeated.

LAST_CELL
which holds the maximum cell number permitted in the X direction.

The class has a single constructor that takes two arguments of type Wizard and assigns them to the two Wizard instance variables.

You are now going to write the various methods in WizardController that animate the wizards. In order to follow the motion of the wizards properly you will need to slow the animation down. To help you do this we have provided a class method delay() in the WizardController class.

e.g. If you want a delay of 100 ms you would insert the following statement at the appropriate point in your code.:

WizardController.delay(100);
Remember to use delay() at the appropriate point in each of the methods you write to animate the wizards.’

You should remind yourself of methods the Wizard class provides now as you will need to use these in your code.

Remember that you cannot make use of the Wizard method getPersona() within the WizardController class.

I.

Write a public class method jump() that returns nothing. It should make the wizard passed as argument jump up one cell position from its current cell then return to its original cell.
Now create an instance of wizard and execute the jump() method passing it as argument to check this works as expected. You’ll find code in the README file that will help you with this.

(3 marks)

II.

Next you are going to create a public class method travel() that takes a single argument of type Wizard and returns no value.
The wizard should move left or right as appropriate one cell at a time.

If the wizard’s cellX value is currently LAST_CELL it should move so that its cellX value is 0.
Otherwise it should move so that its value is LAST_CELL.
Test your code to make sure the wizard behaves as expected.

(5 marks)

iii.

Add an additional boolean argument isMagic to your travel() method, that governs whether the wizard moves straight to its destination or cell by cell in a loop.
Amend the code body of travel() so that for each path, if the argument isMagic is true then the wizard moves straight to its final destination so that cellX is 0 or LAST_CELL as before.

Otherwise the wizard should move as in part (b)(ii).

Test your code to make sure the altered behaviour of the wizard is as expected.

(3 marks)

iv.

Write a public class method switchTrack() that takes two arguments of type Wizard and returns no value. The method should switch the cellY values of the two wizards.
(3 marks)

c.

Now you can complete the code for WizardController to put the movements together.
Uncomment the provided methods:

setUpWizards() which resets each wizard persona to its original cellX and cellY and asks the user how many repeats they want.
flyWizards() which invokes jump(), travel()and jump() on each wizard in turn, moving magically. This is the “fly” action
slitherWizards() which invokes travel()and jump() on each wizard in turn, moving without magic. This is the “slither” action.
Now write a public instance method performMoves() which takes no argument and returns no value.

It should perform the following sequence of actions the number of times requested by the user:

“fly”
the wizards should switch track with each other
“slither”
the wizards should switch tracks again
“fly”
(5 marks)

d.

All the instance methods you have written are public in this question. This is to enable you to test your code easily. Explain with reference to Object Oriented principles which of these instance methods in WizardController needed to be public and why others should have been private.
You are not required to actually change any access modifiers for this question, only discuss what they ought to be.
(2 marks)

The Files need to be put into one folder and then open the project via blue j and the folder with work and open the project.

C# Console Application project

TASK 1:

Create a new C# Console Application project and add a class called Employee. This class should have two
instance variables: a name (of type String) and a salary (of type double). Implement the constructor with
two parameters that will set up the initial values of the instance variables:

public Employee (string employeeName, double currentSalary)
You must implement the following methods:
getName this is an accessor method that should return the name of the employee
getSalary this is an accessor method that should return the salary of the employee in currency format
raiseSalary this method should raise the employees salary by a certain percentage

add a new method Tax(), which calculates how much tax is
deducted from the Employees annual pay, according to the following criteria:

$0 $18,200            0%        Nil
$18,201 $37,000  19%      19c for each $1 over $18,200
$37,001 $90,000  32.5%    $3,572 plus 32.5% of amounts over $37,000
$90,001 $180,000  37%    $20,797 plus 37% of amounts over $90,000
$180,000 and over    45%    $54,096 plus 45% of amounts over $180,000

Use ifelse statements. Make sure that the final program works correctly and meets the specification by testing it with different salaries in the EmployeeProgram class.

TASK 2:

Create a new C# Console Application project and add a class called Car with the following parameters,
which you will set in the constructor:

fuel efficiency which is measured in miles per gallon (mpg);
fuel in the tank (in litres) with an initial value of 0;
total miles driven with an initial value of 0.

Set up a constant to hold the current cost of fuel in dollars per litre. For the purpose of this program, the
cost per litre of petrol is 1.385$.

You must implement the following methods in the Car class:
getFuel this accessor method should return the amount of fuel in the tank
getTotalMiles this accessor method should return the total miles the car has driven
setTotalMiles this mutator method should update the total miles the car has driven
printFuelCost a method that returns the cost of fuel in dollars and cents.
addFuel this method should add fuel to the tank and calculate the cost of the fill
calcCost this method will take the amount of fuel, in litres, and multiply it by the cost of fuel (in
dollars per litre)
convertToLitres this method should accept a parameter for the number of gallons, convert that
value to litres and return the value in litres. This can be done by multiplying the value by 4.546.
drive this method should simulate driving the car for a certain distance in miles. It will accept the
number of miles driven and update the total miles stored for the car.

Then you will need to calculate the fuel used by dividing the distance driven by mpg. This will return the number of gallons used, which you then need to convert into litres. The method should display a message to state the total cost of the journey, in dollars and cents.

For the purposes of this class, you can assume that the drive() method is never called with a distance that consumes more than the available fuel.

Change the default Program main class name to CarProgram. Write appropriate code in the CarProgram class to test all of the methods that you have implemented. Compile, run and check the program for potential errors.

Unity Game Dev

The goal of this milestone is to provide a rst demonstration of your product. You run the show and present your game to us and what it can do. At least the minimal functionality outlined below must be shown during the demo. The demonstrations will take place on the 3rd oor of the Trottier building in the week of March 9th – March 13th 2019, just after Spring break. If your game does not run on the Trottier machines or you prefer running it on your own machines, please bring your devices and set them up in one of the meeting rooms.

Student staff app

implement a new student-staff management software app.  In the first instance you have been asked to build a console proof of concept or prototype.

Write a Console application in C# to implement the details given in the assignment specification below.

Your programme must support the ability to do basic CRUD operations such as adding/editing/removing/finding students, lecturers, etc.  Students, Lecturers and Administrators should be stored in one or more lists.

Create an inheritance hierarchy for this application, below are the minimum amount of classes to use in your programme.

Person Class with properties Name, Phone and Email.

Student Class (should inherit the functionality of the base class Person) with properties Status and StudentID.  A students status can only be either Postgrad or an Undergrad.

Employee Class (should inherit the functionality of the base class Person) with a properties called Salary and EmployementType with a value of JobSharing, FT or PT.

Lecturer Class (should inherit the functionality of the base class Employee) with a properties called Subject Taught and Department, where Department having a value of Arts, Business, Professional or Law.

Administrator Class (again, this should derive from Employee) with properties Grade (with a value of Registrar, Exams Officer, Senior or Junior).

Ensure each class provides an override ToString() method.

Start your classes as immutable, i.e., having read-only properties and only then add setters if you cannot avoid them.

Test your app by writing code in your Main() function that executes all of your functionality to show that it works as expected.

UML Documentation
Create UML documentation which describes the details given above. You will need to determine for yourself any details which are not given in the specification. You should submit the following:

Use Case Diagram
Class Diagram

Technical Merit

You can add additional functionality to your application; you can choose any additional Classes you wish, whether it was something we covered in class or something you researched yourself. 

Whatever you consider as technical merit must be included in your report and, where relevant, in the Use Case Diagram and/or Class Diagram.  Explain in your report the value of this technical merit to your programhow did it make your program better (where better could be more maintainable, more compact, more readable, etc.)

Note: Do not make use of any database functionality or any third party libraries.

C Program

write a simple C program. (No headings or screen captures are required.) You will submit a single .c file.

Here are the requirements of the program:

1. Ask the user for their age in years.

2. Ask them for their height in inches.

3. Ask them for their weight.

4. Calculate and show their age in months.

5. Calculate and show them their height in feet (this will be a decimal number).

6. Calculate and show their BMI.

c programing

I will get Problem Sets in C which I need to accomplish  .I need use  dynamic memory allocation , strings , pointers and structures . So if you are really good , it could be long term relationship .
The Problemsets are like “Create a Game K what is modified version of game 2048 but instead of numbers you have to use alphabets “. It consists of 3 modules . First one is the game K.c module and K.h file with functions which I need to create . Then HOF.c with HOF.h file “The Hall of Fame ”  which include names of players and scores . And the last one is UI.c what is same kind of user graphical user interface there is more options how to make it works with Sdl library or curses or standard output . I have like 2 weeks to make all 3 modules . Every code has to be gnuine I have to submit them . I have to use GCC and valgrind to avoid memory leaks . It wil be translated with
$ gcc -std=c11 -Werror -Wall -Wconversion -lm
I can provide more information .

Java JWJGL Library

USE ONLY NETBEANS 8.2 IDE, NO OTHER IDE’s ALLOWED!

Write a Java program which uses the LWJGL library to draw a window of 640×480 (with a black background).

THIS PROGRAM WILL NOT USE ANY OTHER GRAPHICS LIBRARIES BESIDES LWJGL!

To download and setup LWJGL with Netbeans 8.2 go here:
http://wiki.lwjgl.org/wiki/Setting_Up_LWJGL_with_NetBeans.html

The coordinate system should be centered in this window. Your program will read a file titled ‘coordinates.txt’ and draw the corresponding filled polygon in this window using the scanline polygon fill algorithm.

Each specified polygon should be filled in the color specified in the text file and then undergo the transformations specified in the input file before being drawn on the screen.

Hence you will need to calculate the composition ofthe transformation matrices and then calculate the position of the polygon vertices and then apply the scan line
fill algorithm.

Use the glVertex2f() command to plot the pixel and glColor3f() to specify the color. Finally, your program should also use the input.Keyboard class to have the escape key quit your application.

The given coordinates.txt file will be in the following format:
P 0.5 0.6 0.3
30 300
80 150
160 400
200 150
250 300
T
r 45 0 0
s 0.5 1.5 0 0
t 200 150
r 90 0 0
P 0.2 0.4 0.7
-350 350
-350 350
350 350
350 350
T
r 90 0 0
t 100 100
s 0.5 0.5 0 0

The file coordinates.txt will contain an ordered set of vertices for the polygon. The polygon can be drawn by joining the first vertex to the second, the second to the third and so on, until the final vertex is joined to the first to close the polygon.

It denotes the polygon vertices by using the symbol P and the transformations for that
polygon by using the symbol T. The symbol P is followed by three-float numbers that signify the R, G and B values specifying the fill color of the polygon.

The symbols r, s and t stand for rotation, scaling and translation
respectively. The symbol r is followed by the rotation angle, and the coordinate for the pivot point. Similarly the symbol s is followed by the scaling factors in the x and y direction and the pivot point coordinates.

The symbol t is followed by the translation coordinates in the x and y direction. The sample file shows two polygons and the transformations for each polygon.

When your program is evaluated, a different coordinates.txt file will be used to grade, so be sure your algorithm tests all cases, such as polygons with interior and exterior regions as well as self intersections.

There will be more than two polygons in the test file, so read till end of the file and not just two polygons.

Note: Please do not turn in anything that does not use Java with the LWJGL library.

I have attached a sample coordinates file and a picture with an example of what it should look like. When you are finished, the program should look like the example.png picture.

populatiom

Write a program that prints the current world population on screen. Then give them a choice of at least three locations to put the population in (one of which has to be Texas. The other two can be your choice). It then prints the amount of space per person in sq. ft., sq. mi., and acres for that location.Also, I want you to do the area conversions inside of Python. Start with one of the values (Square Feet, for example) and then get the other values by converting the Square Feet into Square Miles and Acres.

Python Programming with FTK

1.    Write unit tests for the posted solution(s) from a previous assignment:

    Write at least 3 test cases for each function (text and binary files)
o    the tests should try different situations
    You may use 2 test files, or more
o    you may alter the prior test files or make your own

submit (1) your test files used for the unit tests, and (2) your unit test code.