Questions
BankAccount: You will create 3 files: The .h (specification file), .cpp (implementation file) and main file....

BankAccount:
You will create 3 files: The .h (specification file), .cpp (implementation file) and main file. You will practice writing class constants, using data files. You will add methods public and private to your BankAccount class, as well as helper methods in your main class. You will create an array of objects and practice passing objects to and return objects from functions. String functions practice has also been included.

  1. Extend the BankAccount class. The member fields of the class are: Account Name, Account Id, Account Number and Account Balance. The field Account Id (is like a private social security number of type int) Convert the variables MIN_BALANCE=9.99, REWARDS_AMOUNT=1000.00, REWARDS_RATE=0.04 to static class constants Here is the UML for the class:

                                                        BankAccount

-string accountName // First and Last name of Account holder

-int accountId // secret social security number

-int accountNumber // integer

-double accountBalance // current balance amount

+ BankAccount()                     //default constructor that sets name to “”, account number to 0 and balance to 0

+BankAccount(string accountName,int id, int accountNumber, double accountBalance)   // regular constructor

+getAccountBalance(): double // returns the balance

+getAccountName: string // returns name

+getAccountNumber: int

+setAccountBalance(double amount) : void

+equals(BankAccount other) : BankAccount // returns BankAccount object **

-getId():int **

+withdraw(double amount) : bool //deducts from balance and returns true if resulting balance is less than minimum balance

+deposit(double amount): void //adds amount to balance. If amount is greater than rewards amount, calls

// addReward method

-addReward(double amount) void // adds rewards rate * amount to balance

+toString(): String   // return the account information as a string with three lines. “Account Name: “ name

                                                                                                                                                   “Account Number:” number

                                                                                                                                                    “Account Balance:” balance

  1. Create a file called BankAccount.cpp which implements the BankAccount class as given in the UML diagram above. The class will have member variables( attributes/data) and instance methods(behaviours/functions that initialize, access and process data)
  2. Create a driver class to do the following:
    1. Read data from the given file BankData.data and create and array of BankAccount Objects

The order in the file is first name, last name, id, account number, balance. Note that account name consists of both first and last name

  1. Print the array (without secret id) similar to Homeowork2 EXCEPT the account balance must show only 2 decimal digits. You will need to do some string processing.
  2. Find the account with largest balance and print it
  3. Find the account with the smallest balance and print it.
  4. Determine if there are duplicate accounts in the array. If there are then set the duplicate account name to XXXX XXXX and rest of the fields to 0. Note it’s hard to “delete” elements from an array. Or add new accounts if there is no room in the array. If duplicate(s) are found, print the array.


    BankData.dat
    Matilda Patel 453456 1232 -4.00
    Fernando Diaz 323468 1234 250.0
    Vai vu 432657 1240 987.56
    Howard Chen 234129 1236 194.56
    Vai vu 432657 1240 -888987.56
    Sugata Misra 987654 1238 10004.8
    Fernando Diaz 323468 1234 8474.0
    Lily Zhaou 786534 1242 001.98

In: Computer Science

MATLAB Write a code that takes the initial velocity and angle as an input and outputs...

MATLAB

Write a code that takes the initial velocity and angle as an input and outputs the maximum height of the projectile and its air time.

Follow the pseudo code below. This will not be provided in as much detail in the future so you’ll have to provide pseudocode or a flowchart to showcase your logic. For this first assignment though, the logic is laid out below with some indented more detailed instructions.

PROGRAM Trajectory:
Establish the User Interface (Typically referred to as the UI);

INPUT INPUT

Solve
Solve
Print

Start with an explanation of activity

Ask the user for the initial velocity;

Ask the user for the initial angle;

Include descriptive requests for inputs so the user knows what information is required.

for the maximum height the ball reaches;

for the length of time the ball is in the air;

the answers for the user;

Include a description with that return so the user understands what the data is

Plot height versus time; Plot height versus distance;

Do not overwrite your previous figure! This is a new plot but you still want the old one.

Make it clear what the plots are. Label the plot axes with units, include a title, and use a marker for the plot points.

END

In: Computer Science

Can someone show me how to make this javaFx code work? The submit button should remain...

Can someone show me how to make this javaFx code work?

The submit button should remain disabled until:
● There is text in all three fields.
● The two password fields have the same value.
When Submit is clicked, display an Alert that says “Account
Created!”
When Quit is clicked, display an Alert that asks the user if
they are sure they want to quit. If they click OK, quit the
program with System.exit(0). If they click Cancel, the
program keeps running.

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import javafx.scene.layout.GridPane;
import javafx.scene.control.Alert.AlertType;

import java.util.Optional;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {

        Button SubmitHandler = new Button("Submit");
        Button Quit = new Button("Quit");

        Label title = new Label("Create an Account");
        Label label1 = new Label("User Name");
        Label label2 = new Label("Password");
        Label label3 = new Label("Re-enter Password");

        TextField userName = new TextField();
        PasswordField passWord = new PasswordField();
        PasswordField rePassWord = new PasswordField();

        HBox hBox1 = new HBox(title);
        HBox hBox2 = new HBox(51, label1, userName);
        HBox hBox3 = new HBox(60, label2, passWord);
        HBox hBox4 = new HBox(10, label3, rePassWord);
        HBox hBox5 = new HBox(55, SubmitHandler, Quit);

        hBox1.setAlignment(Pos.CENTER);
        hBox2.setAlignment(Pos.BASELINE_RIGHT);
        hBox3.setAlignment(Pos.BASELINE_RIGHT);
        hBox4.setAlignment(Pos.CENTER);
        hBox5.setAlignment(Pos.BASELINE_LEFT);

        hBox1.setPadding(new Insets(10, 10, 10, 10));
        hBox2.setPadding(new Insets(10, 10, 10, 10));
        hBox3.setPadding(new Insets(10, 10, 10, 10));
        hBox4.setPadding(new Insets(10, 10, 10, 10));
        hBox5.setPadding(new Insets(10, 10, 10, 10));

        GridPane gridPane = new GridPane();
        gridPane.add(hBox1, 0, 0);
        gridPane.add(hBox2, 0, 1);
        gridPane.add(hBox3, 0, 2);
        gridPane.add(hBox4, 0, 3);
        gridPane.add(hBox5, 0, 4);


        Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
        primaryStage.setTitle("In class 6");
        primaryStage.setScene(new Scene(gridPane));
        primaryStage.show();


    }

    private EventHandler<ActionEvent> QuitHandler = event -> {
        Alert quitAlert = new Alert(AlertType.CONFIRMATION);
        quitAlert.setTitle("");
        quitAlert.getButtonTypes().add(ButtonType.NO);
        quitAlert.setHeaderText("Save Before Quitting?");
        Optional<ButtonType> result = quitAlert.showAndWait();

        if (result.isPresent() && result.get() == ButtonType.OK)
            System.exit(0);
        if (result.isPresent() && result.get() == ButtonType.NO)
            System.exit(0);
    };

    public static void main(String[] args) {
        launch(args);
    }
}

In: Computer Science

Find the largest number of divisions made by Euclid’s algorithm for computing gcd(m, n) for 1≤...

Find the largest number of divisions made by Euclid’s algorithm for computing gcd(m, n) for 1≤ n ≤ m ≤ 100.

In: Computer Science

Function named FunCount takes three arguments- C, an integer representing the count of elements in input...

Function named FunCount takes three arguments-

C, an integer representing the count of elements in input list

IP- input list of positive integers.

Item- an integer value.

Function FunCount returns an integer representing the count of all the elements of List that are equal to
the given integer value Key.

Example: Don’t take these values in program, take all inputs from user

C = 9, IP= [1,1,4,2,2,3,4,1,2], Item = 2
function will return 3

In: Computer Science

Question 1:  Windows’ Ping sends four echo requests (i.e., four ping requests) to a target by default....

Question 1:  Windows’ Ping sends four echo requests (i.e., four ping requests) to a target by default. Based on what you did in Activity 1 of Lab 4 and/or some of the information available in the Appendix of the Lab 4 assignment (i.e., the last pages in the Lab 4 assignment), which of the following is the appropriate command for pinging target 172.217.4.36 by sending 4 echo requests without changing any of the default pinging options?

  1. ping –l 4 172.217.4.36
  2. ping –r 4 172.217.4.36
  3. ping 172.217.4.36
  4. None of the above

Question 2:  Based on what you did in Activity 1 of Lab 4 and/or some of the information available in the Appendix of the Lab 4 assignment (i.e., the last pages in the Lab 4 assignment), which of the following commands can you use to ping the target 172.217.4.36 repeatedly until you stop the pinging yourself?

  1. ping –r 4 172.217.4.36
  2. ping –repeat 4 172.217.4.36
  3. ping –t 172.217.4.36
  4. None of the above

Question 3: You start pinging with the option of repeatedly pinging a target. Based on what you did in Activity 1 of Lab 4 and/or some of the information available in the Appendix of the Lab 4 assignment (i.e., the last pages in the Lab 4 assignment), which of the following can you use to stop the pinging?

  1. Press the Esc key on the keyboard
  2. Press Shift-Esc
  3. Type Quit
  4. Type Stop
  5. None of the above

In: Computer Science

Question 4: Using _______________________, you will ping sweep 5 targets. fping -g 172.217.4.36 172.217.4.40 fping -g...

Question 4: Using _______________________, you will ping sweep 5 targets.

  1. fping -g 172.217.4.36 172.217.4.40
  2. fping -g 172.217.4.36-40
  3. fping -g 172.217.4.36-5
  4. All of the above

Question 5: The following is not a valid Fping command.
                       Note: This question is about the Fping utility.

  1. fping -g 172.217.4.3 172.217.4.10
  2. fping -g 192.168.1.0/24
  3. fping -g 139.67.8.128-130
  4. None of the above

In: Computer Science

Add a CountGroups method to the linked list class below (OurList). It returns the number of...

Add a CountGroups method to the linked list class below (OurList). It returns the number of groups of a value from the list. The value is passed into the method. A group is one or more values.

Examples using strings:
A list contains the following strings: one, one, dog, dog, one, one, one, dog, dog, dog, dog, one, one, dog, one
   CountGroup(“one”) prints 4 groups of one's
   CountGroup(“dog”) prints 3 groups of dog's

Do not turn in the code below. Turn in only your method.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LinkListExample
{
    public class OurList<T>
    {
        private class Node
        {
            public T Data { get; set; }
            public Node Next { get; set; }
            public Node(T paramData = default(T), Node paramNext = null)
            {
                this.Data = paramData;
                this.Next = paramNext;
            }
        }

        private Node first;

        public OurList()
        {
            first = null;
        }

        public void Clear()     // shown in class notes
        {
            first = null;
        }

        public void AddFirst(T data)     // shown in class notes
        {
            this.first = new Node(data, this.first);
        }

        public void RemoveFirst()     // shown in class notes
        {
            if (first != null)
                first = first.Next;
        }

        public void AddLast(T data)     // shown in class notes
        {
            if (first == null)
                AddFirst(data);
            else
            {
                Node pTmp = first;
                while (pTmp.Next != null)
                    pTmp = pTmp.Next;

                pTmp.Next = new Node(data, null);
            }
        }

        public void RemoveLast()     // shown in class notes
        {
            if (first == null)
                return;
            else if (first.Next == null)
                RemoveFirst();
            else
            {
                Node pTmp = first;
                while (pTmp.Next != null && pTmp.Next.Next != null)
                    pTmp = pTmp.Next;

                pTmp.Next = null;
            }
        }

        public void Display()     // shown in class notes
        {
            Node pTmp = first;
            while (pTmp != null)
            {
                Console.Write("{0}, ", pTmp.Data);
                pTmp = pTmp.Next;
            }
            Console.WriteLine();
        }

        public bool IsEmpty()     // shown in class notes
        {
            if (first == null)
                return true;
            else
                return false;
        }
     }
}

In: Computer Science

what is physical security in your own words

what is physical security in your own words

In: Computer Science

Python 3.7: 1. Write a generator expression that repeats each character in a given string 4...

Python 3.7:

1. Write a generator expression that repeats each character in a given string 4 times. i.e. given “gone”, every time you call the next method on the generator expression it will display “gggg”, then “oooo”, … etc and instantiate it to an object called G.  G = (…..) # generatorExpression object

2. Test and verify that iter(G) and G are the same things. What does this tell you about the nature of a Generator object/expression?

3. Assign Iter(G) to an iterator object called it1 and advance it to the next element by using next method.

4. Instantiate a new Iter(G) object called it2. Use the next method and advance it to the next element. Observe the result and compare it with the results of it1.

5. Does the new Iter(G) object start the iterator from the start of the string object? Write down your understanding/conclusion from this experiment.

6. How can you get back the Iter(G) to point back to the beginning of the string?

In: Computer Science

Write a java program creating an array of the numbers 1 through 10. Shuffle those numbers....

Write a java program creating an array of the numbers 1 through 10. Shuffle those numbers.

Randomly pick a number between one and ten and then sequentially search the array for that number.

Once the number is found, place that number at the top of the list.

Print the list. Perform #3 thru #5 ten times.

In: Computer Science

A. What can happen if pointer is uninitialized. Explain the concept and what should ideally be...


A. What can happen if pointer is uninitialized. Explain the concept and what should ideally be done
in such case

B. Memory was allocated initially for 5 elements, later on two more elements added to list. How can
space be managed in such case. Implement the scenario in C.

In: Computer Science

What are some Linux Server operating system failover technologies? What about premium ones that you can...

  • What are some Linux Server operating system failover technologies? What about premium ones that you can pay for?
  • What are some Windows Server operating system failover technologies? What about premium ones that you can pay for?
  • Discuss the process for failover for both subjects you chose!

In: Computer Science

Consider the following three tables, primary and foreign keys. Table Name        SalesPeople Attribute Name                  &nbsp

Consider the following three tables, primary and foreign keys.

Table Name        SalesPeople

Attribute Name                                Type                                      Key Type

EmployeeNumber             Number                               Primary Key

Name                                   Character

JobTitle                                  Character           

Address                                 Character

PhoneNumber                     Character

YearsInPosition                             Number

Table Name        ProductDescription

Attribute Name                                Type                                      Key Type

                ProductNumber                Number                               Primary Key

                ProductName                  Character           

                ProductPrice                   Number

Table Name        SalesOrder

Attribute Name                                Type                                      Key Type

                SalesOrderNumber        Number                               Primary Key

                ProductNumber               Number                               Foreign Key

                EmployeeNumber           Number                               Foreign Key

                SalesOrderDate                Date

Assume that you draw up a new sales order for each product sold.

Develop the following queries in SQL:

a.       All the Sales People with less than four years in position.

b.      All the Product Names sold on April 4th.

c.       All the Products sold by Sales People less than 3 years in the position.

In: Computer Science

The program is not asking y/n :look below Enter your grade:0.00 F Continue (y/n)y Enter your...

The program is not asking y/n :look below

Enter your grade:0.00
F
Continue (y/n)y
Enter your grade:3.33
B+
Enter your grade:
--------------------------------------------

def calci():
    grade = float(input("Enter your grade:"))
    while (grade <= 4):
        if (grade >= 0.00 and grade <= 0.67):
            print("F")
            break
        elif (grade >= 0.67 and grade <= 0.99):
            print("D-")
            break
        elif (grade >= 1.00 and grade <= 1.32):
            print("D")
            break
        elif (grade >= 1.33 and grade <= 1.66):
            print("D+")
            break
        elif (grade >= 1.67 and grade <= 1.99):
            print("C-")
            break
        elif (grade >= 2.00 and grade <= 2.32):
            print("C")
            break
        elif (grade >= 2.33 and grade <= 2.66):
            print("C+")
        elif (grade >= 2.67 and grade <= 2.99):
            print("B-")
            break
        elif (grade >= 3.00 and grade <= 3.32):
            print("B")
            break
        elif (grade >= 3.33 and grade <= 3.66):
            print("B+")
        elif (grade >= 3.67 and grade <= 3.99):
            print("A-")
            break
        elif (grade == 4.00):
            print("A")
            break
        elif (grade == 4.00):
            print("A+")
        else:
            print("Invalid input enter FLOAT only")
        calci()


def main2():
    question = input("Continue (y/n)")
    if question == "n" or question == "N":
        print("Bye")
    elif question == "y" or question == "Y":
        calci()
        main2()
    else:
        print("Invalid Input-Enter either y or n")
        main2()


print("ISQA 4900 quiz")
calci()
main2()
 fix the error

In: Computer Science