Questions
1. Define a Student class , Student class has the follow data fields added---- major: String...

1. Define a Student class , Student class has the follow data fields added---- major: String gpa: double studentID: String // unique id (Find a solution to manage the generation of unique “studentID”) Methods: double getGPA(); void setGPA(); getMajor(String major) void changeMajor(); 2 String toString(); // of major and GPA ,boolean equals(Object o); // 2 students are equal if them have same // personal information plus same student ID String getNextUniqueID(); // this method should be declared as static.

2.  Redesign Student class : (a) Remove “gpa” data field and related methods (b) Add data field: courses:ArrayList (c) Add the following methods: • boolean addCourse(MyCourse course); // add a course to courses list • boolean removeCourse(Course course); // remove a course from the courses list // based on the course information (courseID) in Course object • boolean removeCourse(int courseID); // search and remove a course from the list // based on the unique courseID • ArrayList getCourseList(); • String getCourseGrade(int courseID); // search for a course by courseID from // “courses” list; if not exist, return “no taken”; otherwise, return a grade // by mapping status to “W”(withdraw), “IP” (in progress), or “A” through // “F” (mapping score to these grades) • double getAverageGPA(); // select courses which have taken from “courses”; // map grade “A” through “F” to 4.0 through 0.0; then calculate // average GPA • toString(), equals()

In: Computer Science

Java Logic - the idea is for this Plumbers.java to ask the customer if there house...

Java Logic - the idea is for this Plumbers.java to ask the customer if there house is flooded , how many rooms, if pipes were damaged and if so how many.. then to pas that information into the plumber constructore and the bill for the services. The ComputePrice() isn't displaying the info and the switches aren't taking in the informations in the display().

import java.util.Scanner;

              
public class Plumber
{
  
   int service;
   int numberRooms;
   int burstPipes;
   int numberPipes;
   double roomsCost;
   double pipesCost;
   private int NumberRooms;
   double cFlood1 = 300.00;
   double cFlood2 = 500.00;
   double cFlood3 = 750.00;
   double cPipe1 = 50.00;
   double cPipe2 = 70.00;
   double cPipe3 =100.00;
   double cost = 0;
   String BurstPipes ="";

    private Plumber(int srv, int numRms, int bstPipes, int numPipes)
    {  
      service = srv;
      numberRooms = numRms;
      burstPipes = bstPipes;
      numberPipes = numPipes;
    }

    private Plumber(int service, int numberRooms, String burstPipes, int numberPipes) {
   
      this.service = service;
      this.numberRooms = numberRooms;
      this.BurstPipes = burstPipes;
      this.numberPipes = numberPipes;
    }



     public void display()
          {
      String p1 = " no rooms flooded",
             p2 = "1 room flooded",
             p3="with 2 rooms flooded",
             p4="with 3 or more rooms flooded",
             p5="\n no burst pipes apparent\n",
             p6="\n and 1 burst pipe apparent\n",
             p7="\n and 2 burst pipes apparent\n",
             p8="\n and 3 burst pipes apparent\n";
              
          
              
               if(service == 1)
              
                   {
                        System.out.println("\nYou have stated that the damage to your house involves a natural flood.");
                       
                            switch(NumberRooms)
                            {
                                case 0:
                                    System.out.printf("%s",p1);
                           
                                case 1:
                                    roomsCost += cFlood1;
                                    System.out.printf("%s",p2);
                                    break;
                                case 2:
                                    roomsCost += cFlood2;
                                    System.out.printf("%s",p3);
                                    break;
                                case 3:
                                    roomsCost += cFlood3;
                                    System.out.printf("%s",p4);
                                    break;
                                
                                }
                              
                                
                    if(BurstPipes.equals("Y") || BurstPipes.equals("y"))
                         {
                            switch(burstPipes)
                            {
                            
                                case 0:
                                     System.out.printf("%s",p5);
                                     break;
                                case 1:
                                    pipesCost += cPipe1;
                                    System.out.printf("%s",p6);
                                    break;
                                case 2:
                                    pipesCost += cPipe2;
                                    System.out.printf("%s",p7);
                                    break;
                                case 3:
                                    pipesCost += cPipe3;
                                    System.out.printf("%s",p8);
                            }
                        
                    
                        }
                    
                    }
               
                }


   public void ComputePrice()
   {
      if(service ==1)     
         cost = roomsCost + pipesCost;
     
         if(!(roomsCost==0))
            System.out.printf("\n%s Room Flood Repair = $%s\n",numberRooms,roomsCost);
     
         if(!(pipesCost==0))
       
         {
            System.out.printf("%s Pipe Repair = $%s\n",numberPipes,pipesCost);
     
         System.out.printf("                 ------------\n" +
         "Estimated Amount Due: $%s\n\n",cost);
     
         System.out.print("** Please Have This Amount Available -" +
         "   Fees Are Due At Time Of Service.\n   This Is An Estimate Only." +
         " Final Bill Will Be Based On Onsite Evaluation." +
         "\n   All Work Will Be Discussed And Agreed Upon Prior To Repairs. **\n\n");
      }
  
      else
    
         System.out.printf("If you need services, please come visit us again.\n\n");        
               
           
    }




   public static void main(String[] args)
   {

   double cFlood1 = 300.00;
   double cFlood2 = 500.00;
   double cFlood3 = 750.00;
   double cPipe1 = 50.00;
   double cPipe2 = 70.00;
   double cPipe3 =100.00;
   double roomsCost;
   double pipesCost;
   double cost = 0.00;
   int service;
   int numberRooms;
   int numberPipes;
   String burstPipes ="";

  
  
  
  

   Scanner userInput = new Scanner(System.in);
  
   System.out.print("\nPlease enter 1 "+ "if there was flood damage>>");
   service = userInput.nextInt();
   System.out.print("\n How many rooms were flooded - 1" + "2" + "3" + "or more >>");
   numberRooms = userInput.nextInt();
   burstPipes = userInput.nextLine();
   System.out.print("\n Were there any burst pipes? Please enter Y" + "or" + "N >>");
   burstPipes = userInput.nextLine();
   System.out.print("\n How many pipes burst? - 1" + "2" + "3" + "or more>>");
   numberPipes = userInput.nextInt();


   Plumber firstCustomer = new Plumber(service, numberRooms, burstPipes,numberPipes);

   firstCustomer.ComputePrice();
   firstCustomer.display();

   }

}

In: Computer Science

Consider a file system using a multi-level indexing scheme in inodes as the file organization. In...

Consider a file system using a multi-level indexing scheme in inodes as the file organization. In this question, you are going to compare symbolic linking with hard linking.

i. (3%) Consider creating a symbolic link abc.txt in the current directory /usr/local/ that links to the file /home/c3230a/intro.txt. Which filesystem data structures need to be involved and/or updated?

ii. (3%) Consider creating a hard link abc.txt in the current directory /usr/local/ that links to the file /home/c3230a/intro.txt. Which filesystem data structures need to be involved and/or updated?

In: Computer Science

TRANSPARANT DATA ENCRYPTION TOPIC INTRODUCTION 150WORDS, DESCRIPTION 250 WORDS,  CONCLUTION 150 WORDS USE OWN WORDS 500 WORDS....

TRANSPARANT DATA ENCRYPTION TOPIC INTRODUCTION 150WORDS, DESCRIPTION 250 WORDS,  CONCLUTION 150 WORDS USE OWN WORDS 500 WORDS. WITH REFERENCE SAFEASSIGN NEEDED

In: Computer Science

Create a class named GroceryList. The attributes will be threeLinkedLists. One LinkedList holds double (currency) values,...

Create a class named GroceryList. The attributes will be threeLinkedLists. One LinkedList holds double (currency) values, one holds integer values, and the last holds String values. The String LinkedList is a list of grocery item names. The double LinkedList holds the cost of that item. The integer LinkedList is the number of those items being purchased.

The constructor will simply create empty lists.

The following are the methods to create for this class:

1. add(String, cost, quantity) : Add the specified items to the next position on each LinkedList (note that will ensure that the index of each item is the same on both LinkedLists).

2. remove(String) : Remove the specified item from BOTH lists. This means find it in the String LinkedList, save that index, and then remove the item at that index from each list.

3. bill() : This method will return the total cost of the items being purchased.

4. receipt() : This method will print the name of each item being purchased, how many of those items are being purchased, and the total cost of that item. The last line will be the total cost of all items being purchased.

java language and it's not custom

In: Computer Science

.Variable created outside of function in the main script are available within the function. (Explain by...

  • .Variable created outside of function in the main script are available within the function. (Explain by giving an example)
    • a/
  • is it possible to include HTML in a PHP script file?explain by giving an example
  • here is a constant: define (“LocalHost”,”127.0.0.1”);
    • which one of the following is the correct way to refer to the above constant?
  • LocalHost
    • b.$LocaolHost
  • how many times will ”I love PHP programming!”be printed in the following program segment?
    • $count = 0
    • While ($count<10)
    • eco
  • the PHP function isset() only returns false if a parameter name is missing. It still returns true if the parameter name exists. True or false
  • Data submitted through the HTTP post method is store in array $_POST. True or false
  • Create an array and call it products that will contain the following key and value pairs:
    • i.”iphone “ :699
    • j.”blackberry” :300
    • k.”Samsung” :799
    • l.”Nokia” : 120
    • use a foreach loop to display the content of this array. Make sure to display both the key and value.
  • What will be the output of the following script?
    • <?php
      • $numbers = [100 , 200 ,300,400] ;
      • $values = array(“Hello”,”world”,from”,”csci2006” );
        • For ($i < count ( $numbers) ; $i++)
        • {              
          • echo “numbers[$i] = “ .$numbers[$i] . “<br /> “;
          • echo “values[$i] . “<br />”;
        • }
    • ?>
  • What classes of information are available via the $_server super global array?

In: Computer Science

IN JAVA 1.Write a class Item with these following requirements ØHas two properties: itemName (text) and...

IN JAVA 1.Write a class Item with these following requirements

ØHas two properties: itemName (text) and MSRP (decimal)

ØHas a getTax() method that has no implementation. This method returns a decimal value

ØHas a finalPrice() method that returns the price after tax

ØThis class cannot be instantiated

ØThis class is encapsulated

2.Write a class Electronics that inherits Item with these following requirements

ØHas two properties: manufacturer (text) and tax (decimal). tax value is shared among all electronic items

ØHas a constructor that initializes all attributes

ØProvide an implementation for getTax()

ØThis class is encapsulated

3.Write a class Shop that sells electronic items with these following requirements

ØHas two properties: shopName (text) and itemSold (collection). itemSold stores all the items that the shop sold. You can choose any Java built-in collection type that you like

ØHas a constructor (you can decide which input to have)

ØHas a method sellItem() that add a sold item to itemSold

ØHas a method getSoldList() that returns the names of all items sold in an array. This method shows an error when the collection is empty

ØThis class is encapsulated

4.Write a class Test that creates a Shop, sells a few items, then test getSoldList() and sortSoldList()

ØAssuming tax rate is 7%

In: Computer Science

Discuss in details the strategic benefits of Business Inelegance systems

Discuss in details the strategic benefits of Business Inelegance systems

In: Computer Science

Write a C++ program to read in various types of test questions (multiple choice and True/False)...

Write a C++ program to read in various types of test questions (multiple choice and True/False) from a test bank (text file), and load the questions into an array of questions. You will need to implement the following class hierarchy (given in UML):

Once the test bank has been loaded, simply iterate over the array of questions and have each question printed out to the screen.

The test bank (text file) will have the following format:

  • Line 1 will be an integer value, indicating how many questions in the file
  • Each question will start with a line that starts with either "MC" or "TF" followed by a space and then the point value of the question.
  • The next line will be the actual question.
  • If the question was True/False, the following line will be the answer, either "True" or "False"
  • If the question was multiple choice, the following line will be an integer value indicating how many choices will be provided for that question. The following lines will be the choices. There will never be more than 6 choices. The final line following the choices will be the answer: "A" or "B" or "C" or "D" or "E" or "F".

For this assignment, you may download this sample code for reference. A sample test bank file is as follows:

3

TF 5

There exist birds that cannot fly?

true

MC 10

Who was the President of the USA in 1991?

6

Richard Nixon

Gerald Ford

Jimmy Carter

Ronald Reagan

George Bush Sr.

Bill Clinton

E

TF 10

The city of Boston hosted the 2004 Summer Olympics?

false

In: Computer Science

Write a C program that accepts a port number as a command line argument, and starts...

Write a C program that accepts a port number as a command line argument, and starts an HTTP server. This server should constantly accept() connections, read requests of the form
GET /path HTTP/1.1\r\n\r\n
read the file indicated by /path, and send it over the "connect" file descriptor returned by the call to accept().

In: Computer Science

Suppose you have a list containing exactly three integer numbers. Each number could be positive, negative,...

Suppose you have a list containing exactly three integer numbers. Each number could be positive, negative, or zero. Write a C program that first asks the user for each of the numbers. After that, it should determine and display the number from the list that is nearest to the positive number five (5).

Examples:
If the numbers are 0, -3, and 8, then the displayed output is 8.
If the numbers are 6, 5, and 4, then the output is 5.
If the numbers are 3, 4, and 11, then the output is 4.
If the numbers are 4, 1, 6, then it turns out that 4 and 6 are both equidistant from 5. In this situation, the output should be the first number checked that satisfied the criterion. For this example, if you started on the left at 4 and proceeded to the right, the output is 4.

In: Computer Science

Is the middleware in an Android System considered an example of a middleware in a distributed...

Is the middleware in an Android System considered an example of a middleware in a distributed system?

In: Computer Science

This is a machine learning question. Please use python and google colab format. PLEASE USE BASIC...

This is a machine learning question. Please use python and google colab format. PLEASE USE BASIC MACHINE LEARNING CODES.

Using the Kaggle diamonds dataset, construct a KNN estimator to predict diamond prices. Choose an appropriate K value and predict the price of a diamond with the following parameters: "carat' : 0.32, 'cut' : Ideal, 'color' : E, 'clarity' : IF, 'depth' : 60.7, 'table' : 58.0, 'x' : 4.46, 'y' : 4.48,  'z': 2.71".

Please change the cut, color and clarity to numbers (Eg: cut: 'Fair' : 1, 'Good' : 2, 'Very Good' : 3, 'Premium' : 4, 'Ideal' : 5) etc. I need to predict the price of the specific diamond stated above. Thank you!

In: Computer Science

Implement the Fibonacci function by means of accumulative parameters so that it runs in linear time....

Implement the Fibonacci function by means of accumulative parameters so that it runs in linear time.

(Please use OCaml, Haskell or another functional language and delineate which you are using. Python won't work, unfortunately.)

In: Computer Science

Calculate the total time to transmit a 1000 KB file over a link in the following...

  1. Calculate the total time to transmit a 1000 KB file over a link in the following cases, assuming the one-way delay in either direction is 50ms, and an initial 2 x RTT of "handshaking" before any data is sent.
    1. The bandwidth is 1.5 Mbps, the packet size including the header is 1 KB of which the header is 40 bytes, and data packets are sent continuously and never lost.
    2. Same as (1), but the packet size is 5 KB (incl. header). ·What happens when 15 packets are lost and have to be retransmitted (no time is wasted in detecting which packets have been lost, the last packet in the stream is not retransmitted).
    3. Same as (1), but after we finish transmitting we must wait for one RTT before transmitting the next packet.
    4. Same as (1), but the link bandwidth is "infinite" ( the transmission time is assumed to be zero). We start by sending one packet in the first (2(1 – 1)), during the second RTT we send two ( 2(2-1) )packets, during the third RTT we send four (2(3-1)), and so on.

In: Computer Science