Questions
Download Jupyter and complete your Assignment. Be sure to write and run the code separately for...

Download Jupyter and complete your Assignment. Be sure to write and run the code separately for each part. Please provide explanation for the code logic behind the code you write / design.

First part: Create Simple Student Class with constructor to get first name and last name.

Second part: Then create Address class with the constructor to get Student Address, the parameters can be , House/Apt Number, Street, Zip, State.

Third part: Modify Student Class so that it will get House/Apt Number, Street, Zip, State. and save address inside the Student as dictionary. Also implement the function in student class that print all addresses in the Student Class.

In: Computer Science

Write a java program that randomizes a list and sorts it. The list will be randomized...

Write a java program that randomizes a list and sorts it.

  1. The list will be randomized to be at least 12 elements and no more than 30 elements with values between 1 and 100.
  2. You will submit one program with two sorts done separately within the program. The list will be re-randomized before reach sort.
  3. Write a flowchart for each sort.

In: Computer Science

Create a class to represent a Mammal object that inherits from (extends) the Animal class. View...

Create a class to represent a Mammal object that inherits from (extends) the Animal class.

View javadoc for the Mammal class and updated Animal class in homework 4

http://comet.lehman.cuny.edu/sfakhouri/teaching/cmp/cmp326/s19/hw/hw4/

Use the description provided below in UML.

Mammal
- tailLength : double
- numLegs : int

+ Mammal()
+ Mammal(double, int)
+ Mammal(String, int, double, double, char, double, int) //pass values to parent’s overloaded constructor
                                                          //and assign valid values to tailLength, numLegs or -1 if invalid

+ setTailLength(double) : void    //if the value is invalid set tailLength to -1
+ getTailLength() : double
+ setNumLegs(int) : void           //if the value is invalid set numLegs to -1
+ getNumLegs() : int
+ printDetails() : void         @Override  //see Note1:
+ toString() : String         @Override  //see Note1:
+ equals(Object) : boolean     @Override  //see Note2:

NOTE1: 
For both the printDetails() and toString() methods include the data from the Animal class, as well as Mammal attributes.  Format the Mammal data as “Mammal: Tail Length: %10.2f | Number of Legs: %4d\n”
Hint: Use super.printDetails() and super.toString()

NOTE2:
For the equals(Object) method, two Mammal objects are considered equal if the 
parent class’s equals method returns true, 
if their numLegs are equal, 
and their tailLength values are within .1 of each other

View javadoc for the Mammal class and updated Animal class in homework 4

http://comet.lehman.cuny.edu/sfakhouri/teaching/cmp/cmp326/s19/hw/hw4/

In: Computer Science

You just landed a job working for a real estate manager. Until now he has been...

You just landed a job working for a real estate manager. Until now he has been doing all his record keeping using paper and pencil. Your boss has finally decided the time has come to purchase a new software system. Your job is to find and compare software options. Find at least five different software options for real estate managment. At least one should be a "Software as a service", one should be "off the shelf", and one should be "proprietary". 1) list each option together with its advantages, disadvantages, and probable cost. 2) make a recommendation for which one you think your boss should go with and why (you can be creative on what the company looks like when deciding why)

In: Computer Science

Write a java program that prints to the screen a countdown 2,4,6,8, and then "Who do...

  1. Write a java program that prints to the screen a countdown 2,4,6,8, and then "Who do we appreciate!" (hint use a for loop).

  2. Create a java program which prints out a random goodwill message i.e. (Have a great day!) please have at least 4 messages.

  3. Write a java program that will ask the user to enter a number and print out to the screen until the number -3 is entered.

  4. Write a JAVA program that calls a method that finds the smaller of two numbers input.

In: Computer Science

use c++ Provide a header file as well. So for this question provide Rational.h, Rantional.cpp Create...

use c++

Provide a header file as well. So for this question provide Rational.h, Rantional.cpp

Create a class called Rantional for performing arithmatic with fractions. Then write a program to test your class. Use integer variables to represent the private data of the class, meaning the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. For example fraction 2/4 would be stored in the object as 1 for the numerator and 2 for the denominator.
Note: Remember that denominator cannot be 0.
Provide public member functions that perform each of the following tasks:
a) add -- Adds 2 rational numbers. Result should be stored in reduced form.
b) subtract -- Subtracts 2 rational numbers. Store result in reduced form.
c) multiply -- Multiplies 2 rational numbers. Store result in reduced form.
Write a main() function to test above functionalites.

Post your output

In: Computer Science

Phyton Please!! Make a program where you enter a dollar amount and the program tells you...

Phyton Please!!

Make a program where you enter a dollar amount and the program tells you how many $5 bills and $1 bills you will receive. Don’t use a dollar amount that equality of 5.

Example:

Enter Amount: (user inserts value)

Amount Entered: $50.00

5 dollar bills: 5

1 dollar bills: 25

In: Computer Science

I want to remove the unnecessary characteristics from json. bad JSON "{\n \"response\": {\n \"Id\": \"1234\",\n...

I want to remove the unnecessary characteristics from json.

bad JSON

 "{\n  \"response\": {\n    \"Id\": \"1234\",\n    \"la\": [\n      {\n        \"op\": \"pic\",\n        \"lbl\": \"33609\",\n 

I want the json to be like this

{"response":{"Id":"1234","la":[{"op":"pic","lbl":"33609","

I have tried to used URLDecoder.decode(param1AfterEncoding, "UTF-8"); but it didn't fix it. I would apperciate any help

In: Computer Science

Java Coding Background You will create a Java class that simulates a water holding tank. The...

Java Coding

Background

You will create a Java class that simulates a water holding tank. The holding tank can hold volumes of water (measured in gallons) that range from 0 (empty) up to a maximum. If more than the maximum capacity is added to the holding tank, an overflow valve causes the excess to be dumped into the sewer system.

Assignment

The class will be named HoldingTank. The class attributes will consist of two int fields – current and maxCapacity. The fields must be private. The current field represents the current number of gallons of water in the tank. The maxCapacity field represents the maximum number of gallons of water that the tank can hold.

The class will contain the following methods:

Constructor – the constructor will initialize the two fields. If current is greater than maxCapacity, it will be set to maxCapacity.

Getters – there will be a getter for each field.

Setters – no setters will be defined for this class

void add(int volume) – add volume gallons to the tank. If the current volume exceeds maxCapacity, it will be set to maxCapacity.

void drain(int volume) – try to remove volume gallons from the tank. If resulting current volume is less than zero, set it to zero.

void print() – prints the current volume of the tank (in gallons)

Now create a Main class with a main method to test the HoldingTank class. Add the following code to the main method.

  1. Create an instance of HoldingTank, named tank with a maximum capacity of 1000 gallons and a current volume of 600 gallons.
  2. Print the current volume of the tank
  3. Add 300 gallons
  4. Drain 50 gallons
  5. Print the current volume of the tank
  6. Add 500 gallons
  7. Drain 250 gallons
  8. Print the current volume of the tank
  9. Drain 1200 gallons
  10. Add 200 gallons
  11. Drain 25 gallons
  12. Print the current volume of the tank

Example Output

The tank volume is 600 gallons

The tank volume is 850 gallons

The tank volume is 750 gallons

The tank volume is 175 gallons

How to connect two files?

My code:

package home;

public class Main {
    public static void main(String[] args) {
        HoldingTank tank = new HoldingTank(600,1000);
        tank.print();
        tank.add(300); error
        tank.drain(50);
        tank.print();
        tank.add(500); error
        tank.drain(250);
        tank.print();
        tank.drain(1200);
        tank.add(200); error
        tank.drain(25);
        tank.print();
    }
}
package home;

public class HoldingTank {
    private int current;
    private int maxCapacity;

    public HoldingTank(int current,int maxCapacity) {
        if (this.current > maxCapacity) {
            this.current = maxCapacity;
        } else {
            this.current = current;
        }
        this.maxCapacity = maxCapacity;
    }
    public  int getCurrent(){
        return  current;
    }

    public int getMaxCapacity() {
        return maxCapacity;
    }
    public void drain(int volume){
        if((this.current-volume)<0){
            this.current = 0;
        }else{
            this.current-= volume;
        }
    }
    public void print(){
        System.out.println("The tank volume is "+this.current+"gallon");
    }
}

In: Computer Science

Java programming. Purpose: Understanding the rotation operation in a search tree Understanding heap & priority queue...

Java programming.

Purpose:

  • Understanding the rotation operation in a search tree
  • Understanding heap & priority queue

Problems:

  • Implementation: Rotation (left & right rotations)
    • Use the code template below.
    • Implement the rotateLeft() and rotateRight() functions.
    • How to test your implementation? When a left rotation is applied to the root, apparently the root is changed. One right rotation will restore the tree back to the original

Sample input:

7
30 15 40 5 20 35 45

Sample output:

in-order: 5 15 20 30 35 40 45 
before rotation: 
pre-order: 30 15 5 20 40 35 45 
after rotating left: 
pre-order: 40 30 15 5 20 35 45 
after rotating right: 
pre-order: 30 15 5 20 40 35 45

USE THE BELOW TEMPLATE:

import java.util.*;
class Node <E> {
private Node<E> left;
private Node<E> right;
private E data;
Node(E data) {
this.data = data;
left = null;
right = null;
}
void setData(E d) {
data = d;
}
E getData() {
return data;
}
void setLeft(Node<E> i) {
left = i;
}
void setRight(Node<E> i) {
right = i;
}
Boolean hasLeft() {
return left != null;
}
Node<E> getLeft() {
return left;
}
Boolean hasRight() {
return right != null;
}
Node<E> getRight() {
return right;
}
}
class BST <E extends Comparable<?super E>> {
private Node<E> root;
BST() {
root = null;
}
Node<E> getRoot() {
return root;
}
void inOrder() {
System.out.print("in-order: ");
inOrder(root);
System.out.println();
}
void inOrder(Node<E>root) {
if(root == null) return;
inOrder(root.getLeft());
System.out.print(root.getData() + " ");
inOrder(root.getRight());
}
void preOrder() {
System.out.print("pre-order: ");
preOrder(root);
System.out.println();
}
void preOrder(Node<E>root) {
if(root == null) return;
System.out.print(root.getData() + " ");
if(root.hasLeft()) preOrder(root.getLeft());
if(root.hasRight()) preOrder(root.getRight());
}
void insert(E data) {
root = insert(root, data);
}
Node<E> insert(Node<E> root, E data) {
if (root == null) {
return new Node<E>(data);
} else {
Node<E> cur;
if (root.getData().compareTo(data) > 0) {
cur = insert(root.getLeft(), data);
root.setLeft(cur);
} else {
cur = insert(root.getRight(), data);
root.setRight(cur);
}
return root;
}
}
//apply left rotate to the root node
void rotateLeft() {
}
//apply right rotate to the root node
void rotateRight() {
}
}
public class RotationMain {
public static void main(String[] argv) {
int n;
Scanner in = new Scanner(System.in);
n = in.nextInt();
BST<Integer> tree = new BST<Integer>();
for(int i = 0; i < n; i ++) {
tree.insert(in.nextInt());
}
in.close();
//if BST is correctly built, items will be displayed in sorted order using
//in-order traversal
tree.inOrder();
System.out.println("before rotation: ");
tree.preOrder();
System.out.println("after rotating left: ");
tree.rotateLeft();
tree.preOrder();
System.out.println("after rotating right: ");
tree.rotateRight();
tree.preOrder();
}
}

In: Computer Science

Question 1: (25 marks) During your study of T215A, you have studied the wireless Networks in...

Question 1:

During your study of T215A, you have studied the wireless Networks in particular the WLAN and very little about the wired LAN. This question aims to focus on the wired LAN – Ethernet. Using your words, answer the following questions?
• Describe Ethernet stating its standard?
• What is the media access control method used in Ethernet? Explain it?
• Explain the MAC address?
• Four fast categories of Ethernet standards are 1000Base-EX, 1000Base-ZX, 1000Base-T and 1000Base-TX, describe the differences between them in terms of medium and range?
• Hub, Switch, and Bridge are important parts of Ethernet network; explain each one of them with stating which layer of the OSI model they belong to?

In: Computer Science

in reference to SQL Database, what are some benefits of creating sequences, indexes, and synonyms?

in reference to SQL Database, what are some benefits of creating sequences, indexes, and synonyms?

In: Computer Science

In Python please:  Number the Lines in a File: Create a program that adds line numbers to...

In Python please:  Number the Lines in a File: Create a program that adds line numbers to a file. The name of the input file will be read from the user, as will the name of the new file that your program will create. Each line in the output file should begin with the line number, followed by a colon and a space, followed by the line from the input file.

In: Computer Science

In no more than 200 words, please identify what are the core components of a Cyber...

In no more than 200 words, please identify what are the core components of a Cyber Incident Response plan? What groups / functions need to be involved in your cyber incident response? Write in details in your own analysis

In: Computer Science

In an asynchronous bus, what are the steps that a master device let a slave device...

In an asynchronous bus, what are the steps that a master device let a slave device do a job?

Please draw the circuit diagram of an SR latch using only NAND gates. Please also show its truth.

In: Computer Science