Questions
the previous one I saw it, I wonder how to do the last one. Read carefully...

the previous one I saw it, I wonder how to do the last one.

Read carefully
See the photo of the algorithm below after reading these instructions: write a program in Python 3 which uses a list. Your program will use a list to store the names and exam scores of students. The program starts by asking how many results will be entered. Then a loop will be used to enter the name and score for each student. As each name and score is entered it is appended to a list (which was initially empty). When the loop is finished (i.e. all scores are entered) the program ends by printing the list.

Make a copy of your Lab6A.py file to Lab6B.py. Amend the comments accordingly for these instructions. Send the list you created in Lab 6A to a function which returns a list of names of all above average students.

In: Computer Science

WE ARE USING PYTHON TO COMPLETE THIS ASSIGNMENT :) THANK YOU! In this programming assignment, you...

WE ARE USING PYTHON TO COMPLETE THIS ASSIGNMENT :) THANK YOU!

In this programming assignment, you will write functions to encrypt and decrypt messages using simple substitution ciphers. Your solution MUST include:

  • a function called encode that takes two parameters:
    • key, a 26-character long string that identifies the ciphertext mapping for each letter of the alphabet, in order;
    • plaintext, a string of unspecified length that represents the message to be encoded.

    encode will return a string representing the ciphertext.

  • a function called decode that takes two parameters:
    • key, a 26-character long string that identifies the ciphertext mapping for each letter of the alphabet, in order;
    • ciphertext, a string of unspecified length that represents the message to be decoded.

    decode will return a string representing the plaintext.

Copy and paste the following statements into your file as the first two statements of your main program. These lines represent Python lists of messages for you to encode and decode to test the functions you write.

    plaintextMessages = [
        ["This is the plaintext message.",
         "bcdefghijklmnopqrstuvwxyza"],
        ["Let the Wookiee win!",
         "epqomxuagrdwkhnftjizlcbvys"],
        ["Baseball is 90% mental. The other half is physical.\n\t\t- Yogi Berra",
         "hnftjizlcbvysepqomxuagrdwk"],
        ["I used to think I was indecisive, but now I'm not too sure.",
         "mqncdaigyhkxflujzervptobws"],
        ["Einstein's equation 'e = mc squared' shows that mass and\n\t\tenergy are interchangeable.",
         "bludcmhojaifxrkzenpsgqtywv"] ]

    codedMessages = [
        ["Uijt jt uif dpefe nfttbhf.",
         "bcdefghijklmnopqrstuvwxyza"],
        ["Qnhxgomhqm gi 10% bnjd eho 90% omwlignh. - Zghe Xmy",
         "epqomxuagrdwkhnftjizlcbvys"],
        ["Ulj njxu htgcfj C'gj jgjm mjfjcgjt cx, 'Ep pej jyxj veprx rlhu\n\t\t uljw'mj tpcez jculjm'. - Mcfvw Zjmghcx",
         "hnftjizlcbvysepqomxuagrdwk"],
        ["M 2-wdme uxc yr kylc ua xykd m qxdlcde, qpv wup cul'v gmtd mlw\n\t\t vuj aue yv. - Hdeew Rdyladxc",
         "mqncdaigyhkxflujzervptobws"] ]

You may alter the spacing or indentation of the two lines to conform to the rest of your code, but you are not allowed to change the strings or structure of the lists.

plaintextMessages is a list consisting of five items. Each item is a list of two strings corresponding to a plaintext message and a key. For each of these five items, you should:

  • print the plaintext message.
  • encode the message and print the ciphertext.
  • decode the ciphertext message you just calculated and print the plaintext message again. The purpose of this is to demonstrate that your encode and decode functions work properly as inverses of each other.

If you have done this correctly, the output from your program for the first data item should look like the following:

plaintext:   This is the plaintext message.
encoded:     Uijt jt uif qmbjoufyu nfttbhf.
re-decoded:  This is the plaintext message.

Then print a blank line to separate this block of three lines from the next block.

codedMessages is a list consisting of four items. Each item is a list of two strings corresponding to a ciphertext message and a key. For each of these four items, you should:

  • print the ciphertext message.
  • decode the message and print the ciphertext.

If you have done this correctly, the output from your program for the first data item should look like the following:

encoded:  Uijt jt uif dpefe nfttbhf.
decoded:  

Then print a blank line to separate this block of two lines from the next block.

Special notes:

  • Encrypted and decrypted lower-case letters should map to lower-case letters, as defined by the key.
  • Encrypted and decrypted upper-case letters should map to upper-case letters. Note that upper-case letters do not appear in the key! (Look at the first character in the expected output shown above: the upper-case "T" maps to an upper-case "U" in the encoded message.) Your program must detect when an upper-case letter appears in the data, and figure out how to convert it to the correct upper-case letter based on the corresponding lower-case letters in the key.
  • Non-alphabetic characters, such as numbers, spaces, tabs, punctuation, etc. should not be changed by either encode() or decode().

In: Computer Science

LP3.1 Assignment: Using Advanced SQL This assignment will assess the competency 3. Construct advanced SQL queries....

LP3.1 Assignment: Using Advanced SQL

This assignment will assess the competency 3. Construct advanced SQL queries.

Directions: Using the sample dataset, create three queries including a search, outer join and subquery. Create a table on how to use the query optimizer with these queries. Include screenshots and an explanation on why and when to use the optimizer.

.

In: Computer Science

You are given two arrays A1 and A2, each with n elements sorted in increasing order....

You are given two arrays A1 and A2, each with n elements sorted in increasing order. For simplicity, you may assume that the keys are all distinct from each other. Describe an o(log n) time algorithm to find the (n/2) th smallest of the 2n keys assuming that n is even.

In: Computer Science

You are to modify the Pez class so that all errors are handled by exceptions. The...

You are to modify the Pez class so that all errors are handled by exceptions. The constructor must be able to handle invalid parameters. The user should not be able to get a piece of candy when the Pez is empty. The user should not be able to put in more candy than the Pez can hold. I would like you to do 3 types of exceptions. One handled within the class itself, one handled by the calling method and one custom made exception. Be sure to comment in the program identifying each type of exception. You have the freedom of choosing which exception style you use where. You will need to submit 3 files, the Pez class, the custom exception class, and a tester program demonstrating that all of your exceptions work properly.

public class Pez
{
  private int candy;
  private final int MAX_PIECES = 12;
  
  public Pez()
  {
    candy = 0;
  }
  
  public Pez(int pieces) //this will need to be error-proofed
  {
    candy = pieces;
  }
  
  public int getCandy() 
  {
    return candy;
  }
  
  public void setCandy(int pieces) //this will need to be error-proofed
  {
    candy = pieces;
  }
  
  public void getAPieceOfCandy() //this will need to be error-proofed
  {
    candy = candy - 1;
  }
  
  public int fillPez() 
  {
    int piecesNeeded = MAX_PIECES - candy;
    candy = MAX_PIECES;
    return piecesNeeded;
  }
  
  public int emptyPez()
  {
    int currentPieces = candy;
    candy = 0;
    return currentPieces;
  }
  
  public void addPieces(int pieces) //this will need to be error-proofed
  {
      candy = candy + pieces;
  }
 
  public String toString()
  {
    String thisPez = "This Pez has " + candy + " pieces of candy";
    return thisPez;
  }
  
  public boolean equals(Pez pez2)
  {
    if(this.candy == pez2.candy)
      return true;
    return false;
  }
      
}

In: Computer Science

This code must be written in Java. This code also needs to include a package and...

This code must be written in Java. This code also needs to include a package and a public static void main(String[] args)

Write a program named DayOfWeek that computes the day of the week for any date entered by the user. The user will be prompted to enter a month, day, and year. The program will then display the day of the week (Sunday..Saturday). The following example shows what the user will see on the screen:

This program calculates the day of the week for any dates.

Enter month (1-12): 9

Enter day (1-31): 25

Enter year: 1998

The day of the week is Friday.

Hint: Use Zeller's congruence to compute the day of the week. Zeller's congruence relies on the following quantities:

J is the century (19, in our example)

K is the year within the century (98, in our example)

m is the month (9, in our example)

q is the day of the month (25, in our example)

The day of the week is determined by the following formula:

h = (q + 26(m + 1) / 10 + K + K / 4 + J / 4 + 5J) mod 7

where the results of the divisions are truncated. The value of h will lie between 0 (Saturday) and 6 (Friday).

Note: Zeller's congruence assumes that January and February are treated as months 13 and 14 of the previous year; this affects the values of K and m, and possibly the value of J. Note that the value of h does not match the desired output of the program, so some adjustment will be necessary. Apply Exception Handling.

In: Computer Science

Write a program that reads a text file and reports the total count of words of...

Write a program that reads a text file and reports the total count of words of each length. A word is defined as any contiguous set of alphanumeric characters, including symbols. For example, in the current sentence there are 10 words. The filename should be given at the command line as an argument. The file should be read one word at a time. A count should be kept for how many words have a given length. For example, the word “frog” is 4 bytes in length; the word “turtle” is 6 bytes in length. The program should report the total word counts of all lengths between 3 and 15 bytes. Words with lengths outside that range should not be counted

In: Computer Science

(1) Explain that a counter-controlled loop is useful when you know how many times a set...

(1) Explain that a counter-controlled loop is useful when you know how many times a set of statements needs to be executed.

(2) Discuss the implementations of the Fibonacci Number program at the end of this section to consolidate the students’ understanding of the while loop repetition structures.

In: Computer Science

6. In the 192.168.0.0/16 address block there are a total of __________ IP version 4 addresses....

6. In the 192.168.0.0/16 address block there are a total of __________ IP version 4 addresses.

65,536

16,777,216

4,096

1,048,576

7. Given the IPv4 address and network mask 134.124.133.139/22, identify the broadcast address in that network (the last address). [you may use the ip_addressing_basics spreadsheet, see "IPv4 Address, Network ID, etc." sheet]

134.124.132.0/22

134.124.133.255/22

134.124.132.255/24

134.124.135.255/22

8. Express the CIDR mask /18 using the dotted decimal notation.

255.255.192.0

255.192.0.0

255.255.255.0

255.255.240.0

9.

Host A has IP address/network mask: 192.168.3.222/27

Host B has IP address/network mask: 192.168.3.225/27

Given the information above, it can be inferred that:

Both host A and host B are on the same network

Host A and Host B are on different networks

Host A and Host B will have the same routing tables

Host A and Host B will be able to communicate directly without an intervening router.

10. A Host (the sending host) is trying to send a packet to another host (the destination host). The sending host knows the IP address of destination host. In deciding how to forward the packet toward destination host, the sending host will:

take the Destination IP address and perform a Logical AND operation with its own (sending hosts') Network Mask to determine if the destination host is on the same network as the sending host.

take the Destination IP address and perform a Logical AND operation with destination host's Network Mask to determine if the destination host is on the same network as the sending host.

always forward all packets to the default gateway and not be concerned with determining if the destination host is on the same network as the sending host.

never forward any packets to the default gateway and not be concerned with determining if the destination host is on the same network as the sending host.

In: Computer Science

Requirement: To create three classes, Account, Transaction, and the main class (with the main method). Please...

Requirement: To create three classes, Account, Transaction, and the main class (with the main method). Please closely follow the requirements below. I only need to know how to create the menu and be able to use it through out the code.

Requirements for the Transaction class: A private Date data field that stores the date of the transaction  A private char data field for the type of the transaction, such as “W” for withdrawal and “D” for deposit  A private double data field for the amount of the transaction  A private double data field for the balance of the account after the transaction  A private String data field for the description of the transaction  A constructor that creates an instance of the Transaction class with specified values of transaction type, amount, balance, and description, and date of the transaction. Note: Instead of passing a Date object to the constructor, you should use the new operator inside the body of the constructor to pass a new Date instance to the date data field. Define the corresponding accessor (get) methods to access a transaction’s date, type, amount, description, and the balance, i.e., you need to define 5 get methods.  Define a toString() method which does not receive parameters but returns a String that summarizes the transaction details, including transaction type, amount, balance after transaction, description of the transaction, and transaction date. You can organize and format the returned String in your own way, but you have to include all of the required information. Note: the purpose of the Transaction class is to describe (record) a banking transaction, i.e., when a transaction happens, you can use the transaction parameters to create an instance of the Transaction class.

Requirements for the Account class:  A private int data field for the id of the account.  A private String data field that stores the name of the customer.  A private double data field for the balance of the account.  A private double data field that stores the current annual interest rate. Key assumptions: (1) all accounts created following this class construct share the same interest rate. (2) While the annual interest rate is a percentage, e. g., 4.5%, but users will instead enter the double number as 4.5. Therefore, you need to divide the annual interest rate by 100 whenever you use it in a calculation.  A private Date data field that stores the account creating date.  A private ArrayList data field that stores a list of transactions for the account. Each element of this ArrayList has to be an instance of the Transaction class defined above.  A no-arg constructor that creates a default account with default variable values.  A constructor that creates an instance of the Account class with a specified id and initial balance.  A constructor that creates an instance of the Account class with a specified id, name, and initial balance. Note: for all constructors, instead of passing a Date object to the constructor, you should use the new operator inside the body of the constructor to pass a new Date instance to the date data field.  Define corresponding accessor (get) and mutator (set) methods to access and reset the account id, balance, and interest rate, i.e., you need to define 3 get methods and 3 set methods. Define corresponding accessor (get) methods to access the account name, transactions, and date created information, i.e., you need to define 3 get methods  Define a method named getMonthlyInterest() that returns the monthly interest earned.  Define a method named withdraw that withdraws a specified amount for a specified purpose from the account and then add this transaction including its description to the ArrayList of transactions.  Define a method named deposit that deposits a specified amount from a specified source to the account and then then add this transaction including its description to the ArrayList of transactions.

Notes: (1) The method getMonthlyInterest() is to return monthly interest earned, not the interest rate. Monthly interest = balance * monthlyInterestRate, where monthlyInterestRate = annualInterestRate/12. (2) The constructors for the Account class will initiate the date data field. (3) You should create the Account and Transaction classes as independent files in the same package of your main class. Requirements for the main class: To test the two classes above, in the main method of your main class you need to do the following first:  Create an instance of the Account class with an annual interest rate of 1.5%, a balance of 1000, an id of 1122, and a name as George.  Deposit $3000 as salary to the account and then withdraw $2500 as rent from the account.

 Print an account summary that shows the account holder’s name, annual interest rate, balance, monthly interest, the date when this account was created, and all transactions. (Check the results of this print statement to verify that your Account and Transaction classes work properly.)  After you pass the above test, continue on to do the rest. Simulate an ATM machine experience: The ATM system will ask users to enter a valid ID first (corresponding to user login). If the entered ID matches to one of the Accounts’ ID, the system will present the user an ATM main menu.

Description of the ATM machine main menu: This ATM machine main menu offers users four choices: choice 1 for viewing the current balance, 2 for withdrawing money, 3 for depositing money, and 4 for exiting the main menu (corresponding to user logoff).  The ATM main menu prompts the user to enter a choice, and depending on the user’s choice it may ask for additional input (i.e., withdraw or deposit amount) before acting on the user’s choice.  Your code should behave properly for each user choice as shown in the sample-run figure at the end.  Description of the sample-run figure (shown at the end): In the sample-run figure below, the user first entered a choice 1 for viewing the current balance, and after hitting the Enter key a statement of balance was shown. Then the user entered 2 for withdrawing money, and after hitting the Enter key the system asked the user to enter the withdraw amount. The user next entered 1 to verify the balance amount. Afterward, the user entered 3 for depositing money, and after hitting the Enter key the system asked the user to enter the deposit amount. Again, The user next entered 1 to verify the balance amount. Lastly, the user entered 4 for exiting the main menu and the system responses by prompting for an id again. In the main method, create an Array of ten accounts with account IDs as 1, 2,. . . , 10, and an initial balance of $100 for each account. You will use this Array to simulate an ATM machine experience in the main method. To do that, you need a Scanner to capture the user’s input and define a few variables. You should also define a few methods in the main class, to be used inside the main method, to make the main method looks lean. There are many options to choose from, and the objective is to model an ATM machine experience described above. Additional simulation requirements: After creating the 10-element array (and a few variables), the system should prompt the user to enter an ID and it will verify if the ID is a valid one. An ID is valid if it matches to one of the accounts of the 10-element Array. If the ID is valid, the ATM main menu (described above) is displayed; otherwise the system will ask the user to enter a correct ID. That is, the system will not present the ATM main menu until the user enters a correct ID. You may have noticed that based on the above ATM simulation description, once the system starts it will not stop because after a user chooses option 4 to exit the ATM system will ask user to enter an ID again. To give users an option exiting the system after a few rounds of ATM simulation, inform users that when entering an ID, enter 0 to exit the ATM run (since valid ids are from 1 to 10). That is, if users enter 0 as ID, instead of showing the main menu, the system will terminate the project, but before that it will print out all ATM transactions for each account (in the Array) that actually incurred transactions.

In: Computer Science

Lab 14 - Krazy Karl's Pizza Order App You have been hired by Krazy Karl’s as...

Lab 14 - Krazy Karl's Pizza Order App

You have been hired by Krazy Karl’s as a freelance application (app) developer. They have asked you to build an app that customers can use to order pizza. The app will ask the user for their name, pizza type, size, and number of pizzas. Then provide the user with an order confirmation, which must include the total cost.

In this lab, you will practice using String format() and switch statements. Additionally, you will write some code in main(), add to computeSize(), write calculateCost(), and add to printOrderInfo().

Step 1 - main()

Adding a do-while loop to main()

Complete the TODO section in main, where you will need to keep asking the user for a number while the number is not 1-4. Use a do while loop to keep asking the user. For each iteration of the loop simply print (do not use println)…

"(1) Small\n(2) Medium\n(3) Large\n(4) Extra-large\nPlease choose a size: "

and get the number from the user. Use numSize to store the user input each time (HINT: use the Scanner method nextInt())

Note: If you copy this line (which we suggest you do to make our auto-grader happy) and the string isn’t blue, you will need to replace the double quotes by manually typing it in. For some reason, zybooks doesn’t like it when you use fancy quotes.

Step 2 - computeSize(int)

Now that you got the size from the user as a number, we need to convert it to a char that is ‘S’, ‘M’, ‘L’ or ‘X’. To do this we will finish the computeSize() method.

Completing computeSize()

The purpose of this method is to get the number the user entered and return the matching character that is the size of the pizza. Example, if computeSize() is passed 1 your method will return ‘S’.

In the method computSize() you will write a switch statement which switches on the int size. The switch statement should return the appropriate character representing the size of pizza chosen. If the user entered 1, return S. If 2, return M. If 3, return L. If 4, return X. If its none of the 4, return ‘U’ for unexpected. Think about whether we need to use break statements in this case because of the returns in the switch statements. Create a switch statement using the parameter size (no if-statements).

The if statement would look like:

if(size == 1){
    return 'S';
} else if (size == 2){
    return 'M';
} else {
    return 'U';
}
 

Step 3 - calculateCost(char,int)

Now that we have the size and number of pizzas(this we did for you in askNumPizzas()), we need to calculate the cost of the meal. To do this you will need to write the method calculateCost() from scratch.

Writing the method calculateCost()

The purpose of this method is to calculate the cost of the order given the size and amount of pizzas.

First, write the method signature. This is a public and static method that returns a double. It also has two parameters, the first is a character representing pizza size and an int representing number of pizzas ordered. The return value will represent the total cost of the order.

Implementing calculateCost()

Now, inside the method body of calculateCost(), declare and initialize a double called cost to 0.0. This will represent the total cost to return at the end of the method. Create a switch statement that uses the character passed into the method.

  • If size is equivalent to ‘S’, re-assign cost to 8.99 multiplied by the int that represents the number of pizzas, this is the second parameter that was passed in to calculateCost().
  • If size is equivalent to ‘M’, re-assign cost to 12.99 multiplied by the number of pizzas.
  • If size is equivalent to ‘L’, re-assign cost to 15.99 multiplied by the number of pizzas.
  • For the default case, re-assign cost to 17.99 multiplied by the number of pizzas.

Note: think about how this is different from the other switch statement and what needs to be considered when implementing it.

After the switch statement, cost will be multiplied by the class constant SALES_TAX.

Finally, return the total cost.

Step 4 - printOrderInfo(String, int, char, int, double)

Completing printOrderInfo()

The purpose of this method is to print out the receipt of the order including the following: name for the order, pizza type, pizza size, number of pizzas, and finally the cost of the order. Most of the method is provided for you. To complete this method, print these this statement using String.format() or printf():

“ with a *some number*% sales tax, your order total is $*some other number*\n*some name*'s pizza will be ready in *some number* minutes.\n”

Note: you’ll need to “hard code” the sales tax to be the int 7 for this print statement and we want the cost represented like an actual price so two trailing decimal points (%.2f).

Below is some detail on how to use String.format() and printf():

PROVIDED CODE:

public class KrazyKarls {
// Class constant
public static final double SALES_TAX = 1.07;

/**
* computeSize() This is a public, static method that returns a character.
* It has one parameter, a int that represents the size.
*
* @param size An int; from main().
* @return A character; to main().
*/
public static char computeSize(int size) {
// Student TODO
  
// end Student TODO
return 'S';
}

/**
* calculateCost() This is a public, static method that returns a
* double. There are two parameters, a character representing pizza size
* and an integer representing number of pizzas ordered.
*
*
* @param size A character; from main().
* @param numPizzas An integer; from main().
* @return A double; to main().
*/
// Student TODO
  
// end Student TODO

/**
* printOrderInfo() This is a public, static method which does not return
* a value to main(). It has four parameters.
*
* @param name A String; from main().
* @param pizzaType An integer; from main().
* @param size A character; from main().
* @param numPizzas An integer; from main().
* @param cost A double; from main().
*/
public static void printOrderInfo(String name, int pizzaType, char size, int numPizzas, double cost) {
int cookTime = (int) (Math.random() * 45) + 5;

System.out.println("Ordered placed by: " + name);
String pizza = "pizza";
if(numPizzas > 1){
pizza += "s";
}

switch(pizzaType){
case 1:
System.out.print(numPizzas + " " + size + " Buffalo Chicken " + pizza);
break;
case 2:
System.out.print(numPizzas + " "+ size + " Loaded Baked Potato " + pizza);
break;
case 3:
System.out.print(numPizzas + " " + size + " North of the Border " + pizza);
break;
default:
System.out.print(numPizzas + " " + size + " Vegetarian " + pizza);
}

// Student TODO

// end Student TODO
}

/**
* main() calls all other methods in this class.
*
* @param args The String array args is not used in this program.
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

String name = askName(input);
System.out.println();

int pizzaType = choosePizzaType(input);
System.out.println();

int numSize = 0;
// Student TODO


// end Student TODO


input.close();
}


//-------------------DO NOT MODIFY CODE BELOW THIS LINE----------------------
public static String askName(Scanner input) {
// Prompt customer for name.
System.out.println("*********************************************");
System.out.println("******* Welcome to Krazy Karl's App *******");
System.out.println("*********************************************");
System.out.print("What is the name for the order: ");
// Assign user input to local String.
String name = input.nextLine();
// Return value of local String.
return name;
}

public static int choosePizzaType(Scanner input) {
// Prompt customer for type of pizza.
System.out.println("Specialty Pizzas...");
System.out.println("(1) Buffalo Chicken");
System.out.println("(2) Loaded Baked Potato");
System.out.println("(3) North of the Border");
System.out.println("(4) Vegetarian");
System.out.print("Please select a pizza using 1, 2, 3, or 4: ");
// Assign user input to local integer.
String pizza = input.nextLine();
// Return value of local integer.
return Integer.parseInt(pizza);
}

public static int askNumPizzas(Scanner input) {
System.out.print("Enter the number of pizzas for this order: ");
String numPizzas = input.next();
return Integer.parseInt(numPizzas);
}

}

In: Computer Science

Write a recursive program in C++ to compute the determinant of an NxN matrix, A. Your...

Write a recursive program in C++ to compute the determinant of an NxN matrix, A. Your program should ask the user to enter the value of N, followed by the path of a file where the entries of the matrix could be found. It should then read the file, compute the determinant and return its value. Compile and run your program.

In: Computer Science

State two direct applications of stacks? State two indirect applications of stacks? Give an example from...

  1. State two direct applications of stacks?
  1. State two indirect applications of stacks?
  1. Give an example from the daily life of queues.
  1. What are the main queue operations and do they do?

In: Computer Science

PointList Class Write a class named PointList that keeps a list of Point objects in an...

PointList Class

Write a class named PointList that keeps a list of Point objects in an ArrayList. The PointList class should accept any object that is an instance of the Point class,, or a subclass of Point. Demonstrate the class in an application.

This is My point class….

public class Point<T>

{

   private T xCoordinate;

private T yCoordinate;

   public Point(T x, T y)

   {

   xCoordinate = x;

   yCoordinate = y;

   }

public void setX(T ){

       xCoordinate = x;

   }

   public void setY(T y) {

       yCoordinate = y;

   }

public T getX(){

       return xCoordinate;

   }

public T getY(){

   return yCoordinate;

   }

}

And this is the starting of my code…my teacher wants it this way

import java.util.ArrayList;

public final class PointList<T extends Point<? extends Number>>

{

ArrayList<T> arrList = new ArrayList<>();

}

In: Computer Science

Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has asked you to...

Driver’s License Exam 20PTS PYTHON AND FLOWCHART The local driver’s license office has asked you to design a program that grades the written portion of the driver’s license exam. The exam has 20 multiple choice questions. Here are the correct answers: 1.B 6.A 11.B 16.C 2.D 7.B 12.C 17.C 3.A 8.A 13.D 18.B 4.A 9.C 14.A 19.D 5.C 10.D 15.D 20.A Your program should store these correct answers in an array. (Store each question’s correct answer in an element of a String array.) The program should ask the user to enter the student’s answers for each of the 20 questions, which should be stored in another array. After the student’s answers have been entered, the program should display a message indicating whether the student passed or failed the exam.(A student must correctly answer 15 of the 20 questions to pass the exam.) It should then display the total number of correctly answered questions, the total number of incorrectly answered questions, and a list showing the question numbers of the incorrectly answered questions.

******Need Python code

***** Need pseudocode and flowgorithm flowchart  

In: Computer Science