Category: Computer science and IT assignments

Create Ethereum token, smart contract, metamask

1. Refer to the Power point and PDF is uploaded. Will need to follow steps.

2. Create your own Crypto-token and smart contract,  following the step by step procedures given in the book, and upload screenshots of your Ether token and contract address using etherscan.io and the metamask plugin.

3. When creating accounts for me please use an account name of jvfly
4. for token name use name is JV4151 or JVS
If you need an email to register anything let me know so i can provide if needed.

**Solidity Programming language**

Ruby console project

Implement a Bread making machine. Each machine has a brand and a name. A machine has the possibility to select from a few pre-established bread types: white, with grains and integral. In the bread composition there is flour, water and yeas. To these it can be added oil, milk, salt, sugar or dried fruits. There are multiple bread making machines, some make simple bread that has 2 sizes, others make also sweet bread and panettone. The implementation of the Bread machine should allow the user to choose if it’s a simple or performant bread machine, the simple one can only make white bread, bread with grains and integral bread in two sizes(small and big), while the performant ones can also make sweet bread and panettone. Once the user chooses the type of bread he wants, he needs to add the quantity for the default ingredients(flour, water and yeast) and if he wants any of the extra ingredients he needs to add the quantity for those too.

ELF Loader

The explanation for the task (in Romanian, translate in English)
https://ocw.cs.pub.ro/courses/so/teme/tema-3

Skeleton which they gave us is in 3-loader. The file to be modified is loader.c
https://github.com/systems-cs-pub-ro/so-assignments

What I have done by now I uploaded as an attachment.

Operating Systems class: A program to compare the performance of the Round Robin, non-preemptive Shortest Job First, and SRTF scheduling algorithms

Objectives:

Write a program to compare the performance of the Round Robin, non-preemptive Shortest Job First, and SRTF scheduling algorithms.

Details:

Input: A file of processes and related CPU burst times and arrival times.  There will be no header in the file and each line will be of the form, “<processID>  <burst time>  <arrival time>” with spaces between each field.
Example:

A  10  0
B    1    1
C  2    3
D  1    0
E    5    1

You should read the data into a data structure.  Then you will simulate the behavior of the 3 scheduling algorithms on the data, one at a time.  For each algorithm, your program will need to print out a sort of vertical Gantt chart followed by some summary statistics.

Gantt chart:
First print the name of the scheduling algorithm, then each time a process is scheduled, print out time of the scheduling decision, the processID, and the reason for the context switch.  When the last process completes, print the end time, and “Complete”.  The 3 possible reasons for a context switch are:

Process terminated

Quantum expired

Process preempted by process with shorter burst time

Example:

SJF Scheduling
0 D      Process terminated
1 B      Process terminated
2 E      Process terminated
7 C      Process terminated
9 A      Process terminated
19 Complete

Summary statistics:  Then print out the turnaround time and waiting time for each process and the average turnaround time and waiting time.
Example:

Process ID

Turnaround Time

Waiting Time

A

19

9

B

1

0

C

6

4

D

1

0

E

6

1

Average

33/5 = 6.6

14/5 = 2.8

Then, repeat for the other 2 scheduling algorithms.

If 2 processes have the same burst length (in SJF) or arrive at the same time (in RR), handle them in alphabetical order.

If a process A is preempted at the same time a new process B arrives, put process A in the queue before B (essentially giving running processes a bit higher priority than new processes.)
You might use an ordered queue to handle prioritization in SJF and SRTF.
Use a quantum of 3 for the Round-Robin scheduler.
Assume no preemption in the shortest-job first scheduler.  Of course, there is preemption in the RR and SRTF schedulers.

How to get started:

Note that this program is essentially a simulation and hence is supposed to simulate the behavior of a real system implementing the scheduling algorithms on a set of processes.  As a result, I would suggest implementing versions of the real data structures that an OS would use here, namely a job queue (a queue of all processes in the system) and a ready queue (the set of jobs ready to run.)  You could then update the ready queue every (simulated) second by moving any jobs which have arrived from the job queue to the ready queue.  Then your scheduling algorithm would examine the ready queue to choose the next process to run.  You might maintain a process burst time or remaining burst time as part of the process record in the event queue as well so that your scheduler has all the information it needs right there.

Remember to do one piece at a time and make sure that you always have something to turn in before moving on to the next piece.  Note that this would include the corresponding output.

How can you check if your output is correct?  (Because you would want to check, right?)  You can easily work out the scheduling order by hand.

Notes:

The inputfile is posted separately.  While you will only hand in output for one input file, your program must work for any input file (specifying no more than 8 processes.)

It’s always a good idea to use a makefile.  You put all your file dependencies in the file and type “make” on the command line to build the project.  Here is an example called “makefile”:
# This is a comment.  OS Program 2
# The 2nd line below must begin with a tab.
kbscheduler: kbscheduler.c
    gcc -Wall kbscheduler.c -o kbscheduler

Requirements:

You may write your program in any language you choose (I WOULD PREFER C++ and C) and it can run on any platform (Windows, Mac, Linux) you choose.

Your program must be well-commented including function headers and explanations of complex code.  Proper indentation is expected.

You must write one program which simulates all 3 scheduling algorithms, not 3 separate programs.

To submit: [THIS IS WHAT I NEED]

A printout of your commented code
A printout of your programs output including the program invocation command (ex. xxscheduler Lab3inputfileS20.)  This would be a typescript file a Linux machine, or you could write to a file.  It could be also be screenshots on a Windows machine although this is the worst option.  In this case, you must be very careful to ensure that the output is legible and shows all output and program invocation.
A paragraph in which you choose one of the three scheduling algorithms and argue why it is better than the others based on the output of your program. For instance, if you choose RR, you must argue why it is better than SJF, and then also argue why it is better than SRTF as the reasons may differ.
How to generate a typescript file:

1. Log on to you Linux account.
2. Start up the script command. “script”
3. Run your program on the input file. “xxscheduler inputfile”
4. Exit from script program. “exit”

The resulting script file is called “typescript”.

Python polymorphism

About: Python polymorphism

Task: Numerical simulation of orbits

The task is to simulate orbits through numerical integration (described below). By swapping one object with another, you can change behavior without changing the other objects.

The system will consist of two components:

– Function objects. These represent the function to be integrated. In this exercise you will create two of these, one without air resistance and one with. By switching function objects, the same integrator can be used for both cases.

– The integrator. The integrator from this exercise is described in the next section.

Numerical integration:

Here is an introduction to how numerical integration is intended.

– You start at time 0 and with a start state that is a vector. For the example of trajectories, the vector is 4 long and contains the elements [x_position, y_position, x_speed, y_speed]. The integrator should be written as generally as possible and be able to take initial state vectors of lengths other than 4.

– Create a matrix (two-dimensional numpy array) where the first number (row) is what time step you are on and second number (column) is the position in the state vector of that time step.

– For each time step from start to finish:

Call the function with the state of the previous time step. The function returns a vector of the same length as the state vector representing how the state changes.

Take the state vector to the previous state. For each element, add the time step length multiplied by the corresponding value in the vector returned from the function.

Put this new state vector into the correct position in the matrix

– Return the matrix

Functions:

The functions in this exercise are represented by classes and should support the following interface (a single method):

– evaluate (time, state vector) -> change vector

The return value is after the arrow to the method.

THE ACTUAL TASKS:

Sub-tasks

a) Write a class for the numeric integrator described in the previous section. The constructor should take the length of the time steps as well as the end time as parameters. The integrator should support the method integrate(function object, initial state) -> matrix

b) Write a class for a basic ball path. The constructor must take into account how strong the gravity is in the constructor. The function is based on the state vector [x_position, y_position, x_speed, y_speed] and must return the change vector [x_speed, y_speed, 0, gravity]

c) Write a class for a sphere trajectory that takes into account air resistance. The constructor should take in how strong gravity is and a constant that states how much air resistance there is called c. The function uses the same state vector as the previous sub task and returns the change vector [x_speed, y_speed, – (c * x_speed * speed), gravity – (c * y_speed * speed)]. Speed is calculated as sqrt (x_speed ** 2 + y_speed ** 2)

d) Write a master program that creates the integrator, creates an object of each of the two functions, and runs the integrator on both. The main program should plot the result. The x and y coordinates of the result of the integration are the first and second columns of the matrix returned from the integrator. As a sample data for the plot you can use a. Gravity -9.81 (negative since positive y-direction is up) b. Time step 0.01 c. End time 0.45 d. Air resistance 0.5 e. Starting state [0,0,1,2]

class Exercise 01

Problem
Write Java class for a Tree class. This class must have methods to

default constructor
set and get the type (coniferous, deciduous, dead)
set and get the variety (for example apple, maple, etc.)
set and get the age
set and get the height
set and get the value
toString method that returns all of the tree information as a string
Remember you must guard against wrong values for type, age, and height.

Special Note: If you use an if statement to error check the type a string, you must use the equals string method not == or !=. Your tester program may appear to work using == or !=. However, the error checking will fail to work correctly when users input values for the type in a client program.

Example to test for a type not equal to dead use

!type.equals(“dead”)
do not use
type != “dead”
Create the Tree class.
Tesing the Tree class: Go to Testing Class Exercise 01
Submit Tree.java to the Blackboard Assignment: classexercise01

unit converter using c language

Design and write a C language program that can be used as a unit converter
application. Your unit converter should contain at least four unit categories,
for example: length, mass, temperature, and time.
The program should display the main menu that contains unit categories that are
available, and the user will be prompted to select a unit category first. After the unit
category has been selected the program should then display another menu (i.e., a
submenu) that contains at least three units or more for the chosen unit category. For
example, if the mass unit category is selected, the units shown in its submenu could be:
kilogram, pound, and ounce.
The user will be prompted next to enter a value (i.e., a floating point number) to be
converted, as well as the two units from the submenu. The first unit is the unit to be
converted, while the second unit is the unit to which the first unit will be converted.
After these two units are selected, the program will compute and display the result of
the conversion. The program will then prompt the user to return to the main menu and
repeat the same process, or terminate the program.
Program requirements:
It is required to use the following C language constructs:
User-Defined Functions
Loops
Decisions

System Design and Implementation

Bank System (Java)

Design a very basic system for a local bank to keep track of its employees, customers, and accounts. The system has users who are either employees or customers. The bank offers three types of accounts: checking, savings, and CD. A customer can have multiple accounts of each type. Inheritance is an important part of this assignment and must be utilized.

(Full / detailed instructions are on the uploaded assignment document)

java program

Exercise 1A) Write a class called SportsCar containing the two instance variables maxSpeed and horsepowerof type int. Both these instance variables must, in any SportsCar object hold values that are greater than certain pre-specified values; otherwise, they do not qualify as proper SportsCarobjects. In our case, the minimum value for maxSpeed is 200 km/hour, and the minimum value for horsepower is 250hp. Include suitable member variables in the SportsCar class to hold these values (maxSpeedRequirement and horsepowerRequirement) and write a method called SportsCheck that returns true if both of the maxSpeed and horsepower for a particular SportsCar object are above the minimum requirements; otherwise false. Write accessor and mutator methods for maxSpeed, horsepower, maxSpeedRequirement and horsepowerRequirement.

Exercise 2A) Write a class called Robot with the following three instance variables: name (string), age (ushort), isOn (bool). Make the program initialize the instance variables to unknown, 0, and false, respectively (without using constructors). Include accessor and mutator methods to assign and retrieve the values of these instance variables. B) Allow the users of the Robot class to set the initial values of the three instance variables when a Robot object is created. To this end declare one constructor with three formal parameters and one default constructor.C) Include a member variable called robotsCreated that keeps track of the number of Robot objects created. Make the constructors update the robotsCreated variable so it is always up to date. Implement the following logic: If robotsCreated is less than 5 when the constructor is called, set isOn to true; otherwise false.

Data Modeling (Oracle SQL Developer)

This assignment is part 2 of a project.  Part one is what is uploaded now.  There is a Word document with some revisions that need to be made to the project prior to starting the assignment instructions, so please implement the corrections first.  Otherwise follow the PDF file for instructions as they are to build upon the existing SQL project.