Questions
parking Ticket simulator For this assignment you will design a set of classes that work together...

parking Ticket simulator For this assignment you will design a set of classes that work together to simulate a police officer issuing a parking ticket. You should design the following classes:

• The ParkedCar Class: This class should simulate a parked car. The class’s responsibili-ties are as follows: – To know the car’s make, model, color, license number, and the number of minutes that the car has been parked.

• The ParkingMeter Class: This class should simulate a parking meter. The class’s only responsibility is as follows: – To know the number of minutes of parking time that has been purchased.

• The ParkingTicket Class: This class should simulate a parking ticket. The class’s responsibilities are as follows:

– To report the make, model, color, and license number of the illegally parked car

– To report the amount of the fine, which is $25 for the first hour or part of an hour that the car is illegally parked, plus $10 for every additional hour or part of an hour that the car is illegally parked

– To report the name and badge number of the police officer issuing the ticket

• The PoliceOfficer Class: This class should simulate a police officer inspecting parked cars. The class’s responsibilities are as follows:

– To know the police officer’s name and badge number

– To examine a ParkedCar object and a ParkingMeter object, and determine whether the car’s time has expired

– To issue a parking ticket (generate a ParkingTicket object) if the car’s time has expired Write a program that demonstrates how these classes collaborate.

Manual grading requirements:

No data must be collected from the user from inside the class constructor or any other methods. Data must be collected outside the class(perhaps in the main) and can be passed into the object through constructors. This applies to Car, ParkingTicket, PoliceOfficer, ParkingMeter and all other classes.

For any constructor, pass only information that is needed to initialize the objects of that class. For example, when you create police officer object, pass only police office information to build the object, not car, or parking meter information.

Mimir Requirements

File name to submit in mimir must be: ParkingCarSimulator.java

Test Case1:

Enter the officer's name
John
Enter officer's badge number
1234
Enter the car's make
Toyota
Enter the car's model
Carolla
Enter the car's color
Purple
Enter the car's liscense number
34RJXYZ
Enter Minutes on car
20
Enter the number of minutes purchased on the meter
15
Car parking time has expired.

Ticket data:

Make: Toyota

Model: Carolla

Color: Purple

Liscense Number: 34RJXYZ

Officer Name: John

Badge Number: 1234

Fine: 25.0

Test Case 2( No Ticket Generated)

Enter the officer's name
Susan
Enter officer's badge number
455454
Enter the car's make
BMW
Enter the car's model
E300
Enter the car's color
White
Enter the car's liscense number
CA3433
Enter Minutes on car
45
Enter the number of minutes purchased on the meter
60
The car parking minutes are valid

Test Case 3( Validate input data)

Enter the officer's name
Adam
Enter officer's badge number
34343
Enter the car's make
Ford
Enter the car's model
Model5
Enter the car's color
Green
Enter the car's liscense number
CA55443
Enter Minutes on car
-12
Invalid Entry. Please try again.
20
Enter the number of minutes purchased on the meter
0
Invalid Entry. Please try again.
-20
Invalid Entry. Please try again.
15
Car parking time has expired.

Ticket data:

Make: Ford

Model: Model5

Color: Green

Liscense Number: CA55443

Officer Name: Adam

Badge Number: 34343

Fine: 25.0

ACTIONS

This is what I have so far

ParkedCar.java file------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

public class ParkedCar {

private String make = new String();

private String model = new String();

private String color = new String();

private String licenseNum = new String();

private int parkedMin;

public ParkedCar(String m1, String m2, String c, String l, int p)

{

make = m1;

model = m2;

color = c;

licenseNum = l;

parkedMin = p;

}

//Create Accessor methods to return Car info

public String getMake() {

return make;

}

public String getModel() {

return model;

}

public String getColor() {

return color;

}

public String getLicense() {

return licenseNum;

}

public int getParkedMinutes() {

return parkedMin;

}

//Create Mutator methods

public void setMake(String m1) {

make = m1;

}

public void setModel(String m2) {

model = m2;

}

public void setColor(String c) {

color = c;

}

public void setLicense(String l) {

licenseNum = l;

}

public void setParkedMinutes(int p) {

parkedMin = p;

}

}

ParkingTicket.java File------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

public class ParkingTicket {

private ParkedCar Car;

private PoliceOfficer officer;

private double fineAmount;

private int minutes;

//Constant

public final double firstHourFine = 25.0;

public final int additionalHourFine = 10;

//Constructor

public ParkingTicket(ParkedCar Car, PoliceOfficer officer) {

}

}

ParkingMeter.java file------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

public class ParkingMeter {

private int purchasedMin;

public ParkingMeter(int p)

{

purchasedMin = p;

}

//Create Accessor methods

public int getPurchasedMin() {

return purchasedMin;

}

//Create Mutator Methods

public void setPurchasedMin(int p) {

purchasedMin = p;

}

}

PoliceOfficer.java File ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

public class PoliceOfficer {

private String officerName;

private int badgeNum;

public PoliceOfficer(String name, int num) {

officerName = name;

badgeNum = num;

}

public String getName() {

return officerName;

}

public int getBadge() {

return badgeNum;

}

public void setName(String name) {

officerName = name;

}

public void setBadge(int num) {

badgeNum = num;

}

}

ParkingSimulatorTest.java file------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

import java.util.Scanner;

public class ParkingSimulatorTest {

public static void main(String[] args) {

String officerName, carMake, carModel, carColor, carLicenseNum;

int minPurchased = 0, parkedMin, badgeNum;

//Create a Scanner object to accept user input

Scanner keyboard = new Scanner(System.in);

System.out.println("Enter the officer's name");

officerName = keyboard.nextLine();

System.out.println("Enter officer's badge number");

badgeNum = keyboard.nextInt();

System.out.println("Enter the car's make");

carMake = keyboard.next();

System.out.println("Enter the car's model");

carModel = keyboard.nextLine();

System.out.println("Enter the car's color");

carColor = keyboard.nextLine();

System.out.println("Enter the car's liscense number");

carLicenseNum = keyboard.nextLine();

System.out.println("Enter Minutes on car");

parkedMin = keyboard.nextInt();

System.out.println("Enter the number of minutes purchased on the meter");

//Create Police Officer Object

PoliceOfficer policeOfficer = new PoliceOfficer(officerName, badgeNum);

//Create car Object

ParkedCar parkedCar = new ParkedCar(carMake, carModel, carColor, carLicenseNum, parkedMin);

//Create a parking meter object

ParkingMeter meter = new ParkingMeter(minPurchased);

}

Please Help I need to know If I am on the right track and what other things do I need.

In: Computer Science

Using C++ Giving change. Implement a program that directs a cashier how to give change. The...

Using C++

Giving change. Implement a program that directs a cashier how to give change. The program has two inputs: the amount due and the amount received from the customer. Compute the difference, and compute the dollars, quarters, dimes, nickels, and pennies that the customer should receive in return.

In: Computer Science

1 When using ASK, FSK or PSK techniques, how can we increase data rate? a. by...

1 When using ASK, FSK or PSK techniques, how can we increase data rate?

a. by decreasing "M" value

b. Hartley’s Law tells us that baud rate will always equal data rate when using ASK, FSK or PSK

c. by increasing M, we can increase the data rate when compared to the baud rate

d. by increasing M, we can increase the baud rate when compared to the data rate

2 Determine the number of “M” value and number of data bits that can be represented using FSK where the possible amplitude values are {0 Hz, 60 Hz}.

a. M=2, N=1 bit per symbol

b. M=4, N=2 bit per symbol

c. M=6, N=3 bit per symbol

d. M=8, N=3 bit per symbol

3 Determine the number of “M” value and number of data bits that can be represented using ASK where the possible amplitude values are {0v, +1v, +2v, +3v, +4v, +5v, +6v, +7v}.

a. M=2, N=1 bit per symbol

b. M=4, N=2 bit per symbol

c. M=6, N=3 bit per symbol

d. M=8, N=3 bit per symbol

4 Determine the number of “M” value and number of data bits that can be represented using PSK where the possible amplitude values are {0, π/8, π/4, π/2}.

a. M=2, N=1 bit per symbol

b. M=4, N=2 bit per symbol

c. M=6, N=3 bit per symbol

d. M=8, N=3 bit per symbol

5 Select the true statement regarding the relationship between data rate (bit rate) and baud rate.

a. data rate is the same as baud rate

b. data rate is not dependent upon “M” (i.e., number of values that a symbol can take on)

c. data rate can be equal to or greater than baud rate depending upon the value of “M”

d. data rate is always less than baud rate

6 Electrical, electromagnetic, and optical symbols are used to represent logical (0s and 1s) data. As such, symbol rate is always equal to data rate, and the two terms can be used interchangeably. True / False

7 Unlike analog communications, digital communications do not involve the use of sinusoidal carriers during the digital modulation process. True/False

In: Computer Science

Develop a Domain Class Model with proper annotation on paper. Music An album has a name...

Develop a Domain Class Model with proper annotation on paper.

Music

An album has a name and a release date. An album has a collection of 1 or more songs. And a song may be on one album, but does not have to be (that is a song can exist whether it is on an album or not). A song has a title and a length in seconds. A song is created by one artist. All artists have a name. There are different kinds of artists. An artist can be an individual person. That is a person is an artist. A group is also an artist. A person has a birth date and a favorite color. And a group has a date that it was established. An artist can perform one or more songs.

Examples:

Lizzo is a person who is an artist. Lizzo was born on April 27, 1988 and her favorite color is orange. Lizzo sings songs like Good as Hell (2 min 38 seconds) and Truth Hurts (2 min 53 seconds). Truth Hurts is on the album Cuz I Love You (2019). Good as Hell is on Coconut Oil (2016).

The Revivalists are a group that is an artist and was established in 2007. The Revivalists have four studio albums: Vital Signs (2010), City of Sound (2014), Men Amongst Mountains (2015) and Take Good Care (2018). The song Wish I knew You is on the album Men Amongst Mountains, and is 4 min 34 seconds.

In: Computer Science

In Java!! Problem 2 – Compute the sum of the series (19%) The natural logarithm of...

In Java!!

Problem 2 – Compute the sum of the series (19%)

The natural logarithm of 2, ln(2), is an irrational number, and can be calculated by using the following series:

1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + 1/7 - 1/8 + ... 1/n

The result is an approximation of ln(2). The result is more accurate when the number n goes larger.
Compute the natural logarithm of 2, by adding up to n terms in the series, where n is a positive integer and input by user.

Requirements:

  1. Use either for or while loop to display the number pattern.

In: Computer Science

Using the windows 32 framework , write an assembly language program ; write a procedure to...

Using the windows 32 framework , write an assembly language program ;

write a procedure to read a string and
shift each character of the string by one. As an example, if your input string is Abcz,
your output should be Bcda. Note that you must test your string for non-alphabetic
characters (such as numbers and special characters). If there are non-alphabetic characters, you should terminate your program with an appropriate message. You should
display your converted string using the output macro.
Hint: Let your procedure returns an empty string, if the parameter is not valid. Then
depending on the return value, print an appropriate message in your main procedure.

In: Computer Science

Module/Week 1 ASSIGNMENT (BASIC ELEMENTS) 1. Install Visual Studio Express 2019 for Windows Desktop (you will...

Module/Week 1 ASSIGNMENT (BASIC ELEMENTS)
1. Install Visual Studio Express 2019 for Windows Desktop (you will need to create a free
Microsoft account as part of this process, if you do not already have one). LINK -
https://www.visualstudio.com/downloads/ Instructions for installation can be found in the
Reading & Study folder of Module/Week 1.
2. Create a new empty project in Visual Studio (VS) called “Hello World,” and then create a
new .cpp file called HelloWorld. Into your HelloWorld.cpp file, copy the contents of the
provided Lab Template (all of your programming assignments must start by copying the
contents of the Lab Template into your main .cpp project file). Then below the “//Program
logic” line add the following code exactly as it appears here: cout << “Hello World!” << endl;
3. Compile and run your code.
Submit C++ Programming Assignment 1 by 11:59 p.m. (ET) on Monday of Module/Week 1

In: Computer Science

I have created a method in java in my menu list and I have to put...

I have created a method in java in my menu list and I have to put all the work into the method but I cannot get it to print and am not sure where I am going wrong. this is my code:

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner in = new Scanner(System.in);

String fName = "";

String lName = "";

double hoursWorked;

double hourlyRate;

int optionOne = 1;

int optionTwo = 2;

int optionThree = 3;

int optionFour = 4;

int choice;

System.out.println("Calculator Menu");

System.out.println("1) Wage Calculator");

System.out.println("2) Coupon Calculator");

System.out.println("3) Roman Number Converter");

System.out.println("4) Exit");

System.out.println("");

System.out.println("Enter choice: ");

choice = in.nextInt();

switch(choice) {

case 1:

System.out.println("Enter first name: ");

fName = in.next();

System.out.println("Enter last name: ");

lName = in.next();

System.out.println("Enter hourly rate: ");

hourlyRate = in.nextDouble();

System.out.println("Enter hours worked: ");

hoursWorked = in.nextDouble();

System.out.printf("Name: " + fName + "," + lName);

System.out.println("");

wageCalculator();

break;

case 2:

double purchaseAmount;

int purchaseType;

final double autoP = 1;

final double frag = 2;

final double acc = 3;

System.out.println("Enter purchase amount: ");

purchaseAmount = in.nextDouble(); {

System.out.println("Choose purchase type: ");

System.out.println("1) Auto Parts");

System.out.println("2) Fragrances");

System.out.println("3) Accessories");

purchaseType = in.nextInt();

} if (purchaseType == autoP) {

System.out.println("Your coupon is: $" + purchaseAmount*.10 + "(Auto Parts)");

} if (purchaseType == frag) {

System.out.println("Your coupon is: $" + purchaseAmount*.15 + "(Fragrances)");

} if (purchaseType == acc) {

System.out.println("Your coupon is: $" + purchaseAmount*.20 + "(Accessories)");

}

break;

case 3:

double calc_wages;

System.out.println("No option right now");

break;

case 4:

System.out.println("Thank you for using our program. Have a great day!");

}

// public static int convertRomanNumber(String str). {

// }

}

private static void wageCalculator() {

// TODO Auto-generated method stub

double hoursWorked = 0;

double hourlyRate = 0;

double overtimeHours;

double overtimePay = 0;

double regularPay = 0;

if (hoursWorked > 40) {

overtimeHours = hoursWorked - 40;

System.out.println("Overtime hours: " + overtimeHours);

overtimePay = overtimeHours*(1.5*hourlyRate);

System.out.println("Overtime Pay: " + overtimePay);

hoursWorked = 40;

}

regularPay = hourlyRate*hoursWorked;

System.out.println("Regular hours worked: " + hoursWorked);

System.out.println("Regular Pay: $" + regularPay);

System.out.printf("Total Pay $%.2f", regularPay + overtimePay);

}

}

In: Computer Science

Please normalize the following table [example from “Microsoft Office 2010: Advanced (Shelly Cashman Series)]. If you...

Please normalize the following table [example from “Microsoft Office 2010: Advanced (Shelly Cashman Series)]. If you read the textbook carefully, you will be able to normalize this table below. If you properly normalize, you will have two tables as answers.

Client Num

Client Name

Street

City

State

Current Due

Recruiter Number

Last Name

First Name

Commission

AC34

Alys Clinic

134 Central

Berridge

CO

$17,500.00

21

Kerry

Alyssa

$17,600.00

BH72

Berls Hospital

415 Main

Berls

CO

$0.00

24

Reeves

Camden

$19,900.00

BL12

Benton Labs

12 Mountain

Denton

CO

$38,225.00

24

Reeves

Camden

$19,900.00

EA45

ENT Assoc.

867 Ridge

Fort Stewart

CO

$12,750.00

27

Fernandez

Jaime

$9,450.00

FD89

Ferb Dentistry

34 Crestview

Berridge

CO

$12,500.00

21

Kerry

Alyssa

$17,600.00

FH22

Family Health

123 Second

Tarleton

CO

$0.00

24

Reeves

Camden

$19,900.00

In: Computer Science

2)Prove, using Boolean Algebra theorems, that the complement of XOR gate is XNOR gate (Hint :...

2)Prove, using Boolean Algebra theorems, that the complement of XOR gate is XNOR gate (Hint : Prove that AB + AB = AB + AB by using De-Morgan’s theorem)

In: Computer Science

2)Prove, using Boolean Algebra theorems, that the complement of XOR gate is XNOR gate(Hint : Prove...

2)Prove, using Boolean Algebra theorems, that the complement of XOR gate is XNOR gate(Hint : Prove that AB + AB = AB + ABby using De-Morgan’s theorem)3)Draw the K-Map for the following Boolean function. Obtain the simplified Sum of Products (SOP) expression, using the K-Map minimization procedure

.?(????)=∑?(1,2,3,5,7,9,11,13)

In: Computer Science

Write a function called format_name that accepts a string in the format of first name followed...

Write a function called format_name that accepts a string in the format of first name followed by last name as a parameter, and then returns a string in reverse order (i.e., last name, first name). You may assume that only a first and last name will be given.

For example, format_name("Jared Smith") should return "Smith, Jared"

Hint: The following String Methods will be useful:

# Returns the lowest index in the string where substring is
# found. Returns -1 if substring is not found
my_string = “eggplant”
index = my_string.find(“plant”)      # returns 3

# Returns all the characters after the specific index
my_string = "hello world!"
print my_string[1:] # returns "ello world!"
print my_string[6:] # returns "world!"

# Returns all the characters before the specific index
my_string = "hello world!"
print my_string[:6] # returns "hello"
print my_string[:1] # returns "h"

Your program should include:

  • A main method that uses user input to prompt and read a string that contains a person's first name and last name
  • A call to format_name and a print statement that prints the output returned by format_name
  • A call to the main function

PLEASE HELP PYTHON COMPUTER SCIENCE

In: Computer Science

Design a combinational logic circuit that performs the function of Full Subtractor. Draw a neat diagram...

Design a combinational logic circuit that performs the function of Full Subtractor. Draw a neat diagram of the final circuit and verify the design for at least two input samples.

In: Computer Science

PC2 and PC4 have been configured correctly with the IP addresses 172.156.2.22 and 172.156.2.44. But PC2...

PC2 and PC4 have been configured correctly with the IP addresses 172.156.2.22 and 172.156.2.44. But PC2 cannot communicate with PC4 (i.e., they cannot ping each other). The network technician knows that the problem is related to some configuration settings.

  1. What would be missing in the configuration? On which device(s)? [write your answer in no more than 25 words]

  2. Based on your answer in (1), what will you do to prove that you are right? [write your answer in no more than 25 words]

  3. Based on your answers in (1) and (2), what will you do to fix the problem? [write your answer in no more than 25 words]

In: Computer Science

IN PYTHON: Write a program that displays the lines from the total.txt file in the following...

IN PYTHON: Write a program that displays the lines from the total.txt file in the following output. Use a try catch phrase to check for errors. Use only one function for this portion [main()]. Remember to use Python. Sample output below:

19
16, 29
3, 30
4, 34

In: Computer Science