Questions
Java Project Tasks: Create a Coin.java class that includes the following:             Takes in a coin...

Java Project

Tasks:

Create a Coin.java class that includes the following:

            Takes in a coin name as part of the constructor and stores it in a private string

            Has a method that returns the coins name

            Has an abstract getvalue method

Create four children classes of Coin.java with the names Penny, Nickle, Dime, and Quarter that includes the following:

            A constructor that passes the coins name to the parent

            A private variable that defines the value of the coin

            A method that returns the coins name via the parent class

            And any other methods that should be required.

Create a Pocket class that includes the following:

            An ArrayList of type coin to manage coins.(You MUST use an ARRAYLIST)

            A method that allows a coin to be added

            A method that allows a coin to be removed

            A method that returns a count of the coins in your arraylist by coin type.

            A method that returns a total value of all the coins in your arraylist   

Create a NoSuchCoin class that will act as your custom exception (see pg.551 in book).

Create a PocketMain class that includes the following :

            Creates an object of type pocket to be used below

            A main method that prompts the user with a menu of options to include:

                        Add a coin (must specify type)

                        Remove a coin (must specify type)

                        Display a coin count

                        Display a total value in the pocket

                        An ability to exit the program

            This method must handle poor user input somehow using your custom exception

YOU MUST COMMENT YOUR CODE SO I KNOW WHAT IS HAPPENING!!!

Deliverables:

Pocket.java

Coin.java

Nickle.java

Penny.java

Dime.java

Quarter.java

PocketMain.Java

NoSuchCoin.java

In: Computer Science

I need assistance on what I am doing wrong, I've been trying to declare "getRandomLetter" as...

I need assistance on what I am doing wrong, I've been trying to declare "getRandomLetter" as a scope, but haven't found how to all day. It's been about 3+ hours and I still have nothing. Please help fix these and let me know what I am doing wrong (There may be more simple ways of coding all this, but I just need help fixing the errors with current code, thank you). I am trying to have buildAcronym() hold the position of going from A-Z , & as well as getRandomLetter() choose a letter from A-Z using the ASCII character set. This is a bit of the prompt where it asks to set these up. If I am off, I do apologize.

Define and overload two void-typed functions named buildAcronym that assign a (pseudo)-random uppercase letter to two (2) or three (3) character parameters, depending on the version called. Each character in an acronym must be a unique uppercase letter. Two arguments (or three, depending on the version called) will be assigned a random character literal, which can then be printed out in main.

These are my errors.

Acronyms.cpp: In function 'void buildAcronym(char, char, char)':
Acronyms.cpp:13:35: error: 'getRandomLetter' was not declared in this scope
getRandomLetter(a , b , c)
^
Acronyms.cpp: In function 'void buildAcronym(char, char)':
Acronyms.cpp:25:24: error: 'getRandomLetter' was not declared in this scope
getRandomLetter(a,b)
^
Acronyms.cpp: In function 'int main()':
Acronyms.cpp:50:39: error: 'getRandomLetter' was not declared in this scope
cout << getRandomLetter(a,b) ;
^
Acronyms.cpp:56:42: error: 'getRandomletter' was not declared in this scope
cout << getRandomletter(a,b,c);
^
Acronyms.cpp:60:9: error: expected ';' before '{' token
{
^
Acronyms.cpp:67:1: error: expected 'while' at end of input
}
^
Acronyms.cpp:67:1: error: expected '(' at end of input
Acronyms.cpp:67:1: error: expected primary-expression at end of input
Acronyms.cpp:67:1: error: expected ')' at end of input
Acronyms.cpp:67:1: error: expected ';' at end of input
Acronyms.cpp:67:1: error: expected '}' at end of input

------------------------------------------------------------------------------------------------------------------------------------

--

--------------------------------------

(there are 3 lines above include Name: Date: Filename: apologies that it is missing)

#include
using namespace std;


void buildAcronym(char a ,char b , char c)
{
if('A'<= b && 'A' <= b && 'A' <= c && a <= 'Z' && b <= 'Z' && c <= 'Z')
{
getRandomLetter(a , b , c)
{
cout << a + rand() % 65 + 90 << "." ;
cout << b + rand() % 65 + 90 << "." ;
cout << c + rand() % 65 + 90 << "." ;
}
}
return ;
}

void buildAcronym(char a , char b)
{
getRandomLetter(a,b)
{
cout << a + rand() % 65 + 90 << "." ;
cout << b + rand() % 65 + 90 << "." ;
}

return ;
}

int main()
{
char a , b , c ;
int choice ;
do
{
cout << "Press 1 for a two letter acronym, and 2 for a three letter acronym. " ;
cin >> choice ;
switch(choice)
{
case 1 :

if (choice == 1)
{

cout << getRandomLetter(a,b) ;
break ;
}
case 2 :
if (choice == 2)
{
cout << getRandomletter(a,b,c);
break;
}
else (choice != 1 && choice != 2)
{
cout << "Press 1 for a two letter acronym, and 2 for a three letter acronym. ";
}
}while(choice!=1 && choice != 2);

return 0;
}

In: Computer Science

1) Explain the process of port mirroring 2) difference between network media and networking device vulnerabilities

1) Explain the process of port mirroring

2) difference between network media and networking device vulnerabilities

In: Computer Science

Write a C++ function to print any given std::array of a given type to the standard...

Write a C++ function to print any given std::array of a given type to the standard output in the form of {element 0, element 1, element 2, ...}. For example given the double array, d_array = {2.1, 3.4, 5.6, 2.9}, you'd print {2.1, 3.4, 5.6, 2.9} to the output upon executing std::cout << d_array; line of code. Your function mus overload << operator.

In: Computer Science

Write a C++ function to print out all unique letters of a given string. You are...

Write a C++ function to print out all unique letters of a given string. You are free to use any C++ standard library functions and STL data structures and algorithms and your math knowledge here. Extend your function to check whether a given word is an English pangram (Links to an external site.). You may consider your test cases only consist with English alphabetical characters and the character.

In: Computer Science

Problem Description A local veterinarian at The Pet Boutique has asked you to create a program...

Problem Description A local veterinarian at The Pet Boutique has asked you to create a program for her office to create invoices for her patient’s office visits. When a customer brings their pet to the boutique, the clerk gets the Customer’s name, address, phone number and email address, as well as the pets name, pet type, pet age, and pet weight. After the customer sees the Veterinarian, the clerk determines the charges for the services, and medications for the office visit and prints the invoice for the customer’s records. The invoice should include the Customer’s name, address, phone, and email address, the pet’s name, type, age, and weight, service charges, medication charges, sales tax, and the total charges for the office visit. All calculations should take place in the class methods. All display should use method calls to the get methods from the classes to display the appropriate information. Do not accept any numbers that are less than or equal to zero. Calculate the sales tax using a constant equal to .0925 and limit the display to two decimal places. in Java

In: Computer Science

Hi, I am wondering how to create code that will allow (in c) the console to...

Hi, I am wondering how to create code that will allow (in c) the console to read a password from a .txt file, and have the ability to change this password?

I have a function that logs certain users in using simple if statements and hardcoded passwords, but i would like the ability to be able to change the password and read it from a .txt so it is editable instead of having it in a function in the code.

Thanks

In: Computer Science

i have this problem write an application that evaluates the factorials of the integeres from 1...

i have this problem write an application that evaluates the factorials of the integeres from 1 to 5 . i have this
!

control.WriteLine( "n\tn!;n");

for (in number=1; number <=5; number ++);

{

int factorail=1:

for (int 1=1; i<=number;1++);

factorial *=1:

Console.Writeline("{0}\t{1}".number,factorial);

output

n n!

1 1

2 2

3 6

4 24

5 120

I understand how the first row is printed.  

the first 1 in because the intfactorial is 1

the #2 if printed becasue in number =1; number<=5; number ++ =2

then it runs again number=2; number <=5; number ++ ) number is 3

then it runs again number=3; number <=5; number ++) number is 4

then it runs again number=4); njmber <=5; number ++) number is 5 and then ends because it hits <=5 and becomes true

so it goes to the next

for (int i=1; i<=number; i++

factorial *=1;

not sure how this works or comes up the mulipliers

In: Computer Science

Please attach the output screenshots, narrative descriptions, or paste the Python codes when requested. Task 2...

Please attach the output screenshots, narrative descriptions, or paste the Python codes when requested.

Task 2

Please define a function that extracts the even numbers in a given list. For example, given a list x = [2,3,5,6,7], the function will return a sublist [2,6] because 2 and 6 are even numbers in the list x.

The input of this function should be a list, and the output of the function should be a list as well (the sublist).

You can try the inline for loop with conditions to make the solution super simple.

Task 3

Use inline for loop to extract the common elements in two lists. For example, if x = [1,2,3], and y = [2,3,4], the result should be [2,3].

Hint: to check if a value exists in a list, you can use the “in” command. For example: we define two variables

a = 2 in [1,2,3]

b = 4 in [1,2,3].

After executing the codes, a will be a “True”, and b will be a “False”.

In: Computer Science

Digital security is an increasing concern is the Internet age. In order to protect sensitive information...

Digital security is an increasing concern is the Internet age. In order to protect sensitive information online, what are the methods for enhancing digital security? Select one method and describe in detail how it is implemented and how you would implement it to protect your online data.

In: Computer Science

Java Write a method that removes duplicates from an array of strings and returns a new...

Java

Write a method that removes duplicates from an array of strings and returns a new array, free of any duplicate strings.

In: Computer Science

Create a Java application to simulate a “GradeBook”. A teacher has five students who have taken...

Create a Java application to simulate a “GradeBook”. A teacher has five students who have taken four exams. The teacher uses the following grading scale to assign a letter grade to a student, based on the average of his or her four exam scores:

Average

Letter Grade

90 – 100

A

80 – 89

B

70 – 79

C

60 – 69

D

0 – 59

F

Write logic to create a String array to hold student names, a character array to hold student letter grades, and a two-dimensional array to hold each of the five students’ test scores for each of the four exams completed during the semester.

Use nested for loop logic to fill the names and test scores arrays. Do not accept test scores less than zero or greater than 100. Make sure you test both ends of the range!

Use another nested for loop to compute the average test score for each student and then assign the corresponding letter the letter grade array. Make sure you test each letter grade value!

Use while loop logic to display a table showing each student’s name and letter grade.

In: Computer Science

How can I check to see if 2 arrays contain the same element using nothing worse...

How can I check to see if 2 arrays contain the same element using nothing worse than linear runtime? (Java)

For example if I have 2 arrays with elements {7, 8, 5, 4, 3} and {10, 12, 15, 20, 8}

I would want it to return true since there is an 8 in each array.

In: Computer Science

(PYTHON) A beard-second is a unit of length inspired by the light-year and is defined as...

(PYTHON) A beard-second is a unit of length inspired by the light-year and is defined as the length the average beard grows in one second, or precisely 5 nanometers. The beard-second is used for extremely short distances such as measurements within an integrated circuit. Your manufacturing equipment is very accurate but it uses inches as a unit of measurement, so you need a conversion table between beard-seconds and inches to complete a special order.

The following information should be helpful: 1 beard second = 5 nanometers 1 nanometer = 3.937e-8 inches

Write a program named beard.py that includes two functions main() and inches()which are used to produce a conversion table between beard seconds and inches for a series of values specified by the user.

The main() function: • Displays a description of the program’s function • Prompts the user for the starting and ending beard second value to be converted to inches • Displays a table header (see examples) • Using a loop, calls the inches() function repeatedly to calculate the converted values • The beard second values should increment by 250

The inches() function: • Accepts one (1) value in beard seconds as an argument • Performs the conversion calculation from beard seconds to inches • Displays the table row including the beard seconds and inches values (to 8 decimal places) • Beard second values should have a thousands comma separator • Does not return any values

In: Computer Science

Write a program that reads two square Matrices of size 2 *2 and calculate and print...

Write a program that reads two square Matrices of size 2 *2 and calculate and print the sum of them. Also, the signed value of the matrices are input by the user Note: 1) Use CamelCase for variables names 2) Write Comments such as your name, the class, description of the program, and description of your logic. 4) Use sematic names for your variables 5) Your program should be C program not C++.

In: Computer Science