Questions
Q2: Explain the generic model of the process of making and using digital signature?

Q2: Explain the generic model of the process of making and using digital signature?

In: Computer Science

In Python please. Construct a large file of data in random order where the key is...

In Python please.

Construct a large file of data in random order where the key is a 13-digit number.
Then sort in two different ways. Use a Quick sort and then use a radix sort of some kind. Code both sorts in the same language and run experiments to see at what size of data does the radix run faster than the Quick sort.

In: Computer Science

Answer in Python: show all code 3) Modify your code to take as input from the...

Answer in Python: show all code

3) Modify your code to take as input from the user the starting balance, the starting and ending interest rates, and the number of years the money is in the account. In addition, change your code (from problem 2) so that the program only prints out the balance at the end of the last year the money is in the account. (That is, don’t print out the balance during the intervening years.)

Sample Interaction:

Enter starting balance: 1000

Enter starting interest rate: 3

Enter ending interest rate: 5

Enter number of years: 5

Interest rate of 3 %:

Balance after year 5 is $ 1159.27

Interest rate of 4 %:

Balance after year 5 is $ 1216.65

Interest rate of 5 %:

Balance after year 5 is $ 1276.28

problem 2 instruction: to reference for this question:

2) For the last assignment you had to write a program that calculated and displayed the end of year balances in a savings account if $1,000 is put in the account at 6% interest for five years.

The program output looked like this:

Balance after year 1 is $ 1060.0

Balance after year 2 is $ 1123.6

Balance after year 3 is $ 1191.02

Balance after year 4 is $ 1262.48

Balance after year 5 is $ 1338.23

Modify your code so that it displays the balances for interest rates from three to five percent inclusive, in one percent intervals. (Hint: Use an outer loop that iterates on the interest rate, and an inner one that iterates on the year.)

Output:

Interest rate of 3 %:

Balance after year 1 is $ 1030.0

Balance after year 2 is $ 1060.9

Balance after year 3 is $ 1092.73

Balance after year 4 is $ 1125.51

Balance after year 5 is $ 1159.27

In: Computer Science

Write a C program that uses a loop which prompts a user for an integer 10...

Write a C program that uses a loop which prompts a user for an integer 10 times and stores those integers in an array. The program will print out the numbers entered by the user with a comma and a space separating each number so the numbers can be read easily. The program will then calculate and print out the sum, integer average and floating point average (to 4 decimal points) of the numbers in the array. The information being printed out should be labeled correctly with newline characters placed so the output is readable. You will also create a BubbleSort function to sort the integers from small to large. The array will be passed by reference to the function where the function will reorder the integers in the array. You should not duplicate the array in anyway.

Remember your assignment must be submitted by 11:59:59pm on the due date, or else it will be considered late and will not be accepted. Please make sure your C code is thoroughly commented to explain what your program is doing. You should only submit the C source code, not the compiled program.

NOTE: Pseudo-code for a basic Bubble Sort routine:

procedure BubbleSort( A : array of integers to sort)
  repeat
    swapped = false
      for item in A inclusive do:
        if A[i-1] > A[i] then
          swap A[i-1] and A[i]
          swapped = true
        end if
      end for
  until not swapped
end procedure

Sample Output:

$>./assignment3
Enter element  1 into the array 5
Enter element  2 into the array 7
Enter element  3 into the array 6
Enter element  4 into the array 1
Enter element  5 into the array 2
Enter element  6 into the array 3
Enter element  7 into the array 4
Enter element  8 into the array 8
Enter element  9 into the array 9
Enter element 10 into the array 0

5, 7, 6, 1, 2, 3, 4, 8, 9, 0

The sum of the integers in the array is 45
The integer average of the integers in the array is 4
The float average of the integers in the array is 4.5000

0, 1, 2, 3, 4, 5, 6, 7, 8, 9
$>

In: Computer Science

c++ Design the Weather class that contains the following members: Data members to store: -a day...

c++

Design the Weather class that contains the following members:

Data members to store:

-a day (an integer)

-a month (an integer)

-a year (an integer)

-a temperature (a float)

-a static data member that stores the total of all temperatures (a float)

Member functions:

-a constructor function that obtains a day, month, year and temperature from the user. This function should also accumulate/calculate the total of all temperatures (i.e., add the newly entered temperature to the total).

-a static function that computes and displays the day which has the lowest temperature. Note: An array of Weather objects and the size of the array will be passed to this function.

-a static function that computes and displays the average temperature. This function should use a parameter,if necessary.

Design the main( )function, which instantiates/creates any number of objects of the Weather class as requested by the user (i.e., creates a dynamic array of Weather objects). main( )should also call appropriate functions to compute and display the day that has the lowest temperature, as well as the average temperature.Your program should include all necessary error checking.

A sample run of this program could be as follows:

How many days => 4

Enter day, month, year, temperature => 29 11 2018 15.6

Enter day, month, year, temperature => 30 11 2018 8.7

Enter day, month, year, temperature => 1 12 2018 3.1

Enter day, month, year, temperature => 2 12 2018 3.5

Lowest temperature = 3.1C, Day 1/12/2018

Average temperature = 7.7 C

In: Computer Science

Soccer League Java homework assignment. Below is the assignment brief. It requires to have the necessary...

Soccer League

Java homework assignment.

Below is the assignment brief.

It requires to have the necessary java classes created: 'Team', 'Game', 'Schedule', and 'Main'.

All attributes are private, and getters/setters are created.

The sample output should be as stated below.

Overview

It has been a brutally cold and snowy winter. None of your friends have wanted to play soccer. But now that spring has arrived, another season of the league can begin. Your challenge is to write a program that models a soccer league and keeps track of the season’s statistics. There are 4 teams in the league. Matchups are determined at random. 2 games are played every Tuesday, which allows every team to participate weekly. There is no set number of games per season. The season continues until winter arrives. The league is very temperature sensitive. Defenses are sluggish on hot days. Hotter days allow for the possibility of more goals during a game. If the temperature is freezing, no games are played that week. If there are 3 consecutive weeks of freezing temperatures, then winter has arrived, and the season is over.

Task

Write a program that models a soccer league and keeps track of the season’s statistics. Carefully consider what data should be stored in an array and what data should be stored in an Array List. Design classes with fields and methods based on the description of the league. You will also need a test class that contains the main method. All fields must be private. Provide any necessary getters and setters.

Team

Each team has a name. The program should also keep track of each team’s win-total, loss-total, tie total, total goals scored, and total goals allowed. Create an array of teams that the scheduler will manage. Print each team’s statistics when the season ends.

Game

In a game, it is important to note each team’s name, each team’s score, and the temperature that day. Number each game with an integer ID number. This number increases as each game are played. Keep track of every game played this season. This class stores an Array List of all games as a field. Your program should determine scores at random. The maximum number of goals any one team can score should increase proportionally with the temperature. But make sure these numbers are somewhat reasonable. When the season ends, print the statistics of each game. Print the hottest temperature and average temperature for the season.

Schedule

Accept user input through a JOptionPane or Scanner. While the application is running, ask the user to input a temperature. The program should not crash because of user input. If it is warm enough to play, schedule 2 games. Opponents are chosen at random. Make sure teams are not scheduled to play against themselves. If there are 3 consecutive weeks of freezing temperatures, the season is over.

Sample Output:

run:

Too cold to play.

Too cold to play.

Too cold to play.

Season is over

*********RESULTS*********

Team 1

Wins: 1, Losses: 1, Ties:0

Points Scored: 9, Points Allowed: 9

Team 2 Wins: 1, Losses: 1, Ties:0

Points Scored: 8, Points Allowed: 8

Team 3 Wins: 0, Losses: 1, Ties:1

Points Scored: 6, Points Allowed: 9

Team 4 Wins: 1, Losses: 0, Ties:1

Points Scored: 8, Points Allowed: 5

Game #1

Temperature: 90

Away Team: Team 2, 4

Home Team: Team 4, 7

Game #2

Temperature: 90

Away Team: Team 1, 8

Home Team: Team 3, 5

Game #3 Temperature: 35

Away Team: Team 1, 1

Home Team: Team 2, 4

Game #4

Temperature: 35

Away Team: Team 3, 1

Home Team: Team 4, 1

Hottest Temp: 90

Average Temp:62.5

In: Computer Science

java Introduction: Runtime complexity is an issue when determining which algorithms we should use. Some algorithms...

java

Introduction:

Runtime complexity is an issue when determining which algorithms we should use. Some algorithms are easy to implement but run too slowly to be useful. Knowing the advantages and disadvantages of different algorithms helps in determining the best solution to a problem.

Description:

You are to implement two different sorting algorithms and count the number of steps involved with the sort routine (the comparisons and moving positions). Every time a comparison or move is made you should count it.

You have been given a data file with text. You must read through the file to determine the number of words in it, then create an array big enough to hold the values. Once the array is built you need to reread the file to store the strings into the array.

You must implement Insertion Sort and Quick Sort. These sorts must take an array of strings and sort them in ascending order. When sorted you must display each UNIQUE value and the number of times it appears in the array. At the end you must print out which sort was used and how many steps it took to complete.

You must keep asking the user which sort to use until the Exit symbol is entered. Remember that passing an array to a method will modify the original array. You must copy the array so you do not lose the order of the original and just sort the copy.

Program:

You must create a program called p6.java. Everything can be done inside of this file if done within the same class. If you wish to create additional classes to help, you must have them in separate .java files.

Input:

There is an input file called p6.dat were each line contains a name.

p6.dat content:

I AM SAM. I AM SAM. SAM-I-AM. THAT SAM-I-AM! THAT SAM-I-AM! I DO NOT LIKE THAT SAM-I-AM! DO WOULD YOU LIKE GREEN EGGS AND HAM? I DO NOT LIKE THEM,SAM-I-AM. I DO NOT LIKE GREEN EGGS AND HAM. WOULD YOU LIKE THEM HERE OR THERE? I WOULD NOT LIKE THEM HERE OR THERE. I WOULD NOT LIKE THEM ANYWHERE. I DO NOT LIKE GREEN EGGS AND HAM. I DO NOT LIKE THEM, SAM-I-AM. WOULD YOU LIKE THEM IN A HOUSE? WOULD YOU LIKE THEN WITH A MOUSE? I DO NOT LIKE THEM IN A HOUSE. I DO NOT LIKE THEM WITH A MOUSE. I DO NOT LIKE THEM HERE OR THERE. I DO NOT LIKE THEM ANYWHERE. I DO NOT LIKE GREEN EGGS AND HAM. I DO NOT LIKE THEM, SAM-I-AM. WOULD YOU EAT THEM IN A BOX? WOULD YOU EAT THEM WITH A FOX? NOT IN A BOX. NOT WITH A FOX. NOT IN A HOUSE. NOT WITH A MOUSE. I WOULD NOT EAT THEM HERE OR THERE. I WOULD NOT EAT THEM ANYWHERE. I WOULD NOT EAT GREEN EGGS AND HAM. I DO NOT LIKE THEM, SAM-I-AM. WOULD YOU? COULD YOU? IN A CAR? EAT THEM! EAT THEM! HERE THEY ARE. I WOULD NOT, COULD NOT, IN A CAR. YOU MAY LIKE THEM. YOU WILL SEE. YOU MAY LIKE THEM IN A TREE! I WOULD NOT, COULD NOT IN A TREE. NOT IN A CAR! YOU LET ME BE. I DO NOT LIKE THEM IN A BOX. I DO NOT LIKE THEM WITH A FOX. I DO NOT LIKE THEM IN A HOUSE. I DO NOT LIKE THEM WITH A MOUSE. I DO NOT LIKE THEM HERE OR THERE. I DO NOT LIKE THEM ANYWHERE. I DO NOT LIKE GREEN EGGS AND HAM. I DO NOT LIKE THEM, SAM-I-AM. A TRAIN! A TRAIN! A TRAIN! A TRAIN! COULD YOU, WOULD YOU ON A TRAIN? NOT ON TRAIN! NOT IN A TREE! NOT IN A CAR! SAM! LET ME BE! I WOULD NOT, COULD NOT, IN A BOX. I WOULD NOT, COULD NOT, WITH A FOX. I WILL NOT EAT THEM IN A HOUSE. I WILL NOT EAT THEM HERE OR THERE. I WILL NOT EAT THEM ANYWHERE. I DO NOT EAT GREEM EGGS AND HAM. I DO NOT LIKE THEM, SAM-I-AM. SAY! IN THE DARK? HERE IN THE DARK! WOULD YOU, COULD YOU, IN THE DARK? I WOULD NOT, COULD NOT, IN THE DARK. WOULD YOU COULD YOU IN THE RAIN? I WOULD NOT, COULD NOT IN THE RAIN. NOT IN THE DARK. NOT ON A TRAIN. NOT IN A CAR. NOT IN A TREE. I DO NOT LIKE THEM, SAM, YOU SEE. NOT IN A HOUSE. NOT IN A BOX. NOT WITH A MOUSE. NOT WITH A FOX. I WILL NOT EAT THEM HERE OR THERE. I DO NOT LIKE THEM ANYWHERE! YOU DO NOT LIKE GREEN EGGS AND HAM? I DO NOT LIKE THEM, SAM-I-AM. COULD YOU, WOULD YOU, WITH A GOAT? I WOULD NOT, COULD NOT WITH A GOAT! WOULD YOU, COULD YOU, ON A BOAT? I COULD NOT, WOULD NOT, ON A BOAT. I WILL NOT, WILL NOT, WITH A GOAT. I WILL NOT EAT THEM IN THE RAIN. NOT IN THE DARK! NOT IN A TREE! NOT IN A CAR! YOU LET ME BE! I DO NOT LIKE THEM IN A BOX. I DO NOT LIKE THEM WITH A FOX. I WILL NOT EAT THEM IN A HOUSE. I DO NOT LIKE THEM WITH A MOUSE. I DO NOT LIKE THEM HERE OR THERE. I DO NOT LIKE THEM ANYWHERE! I DO NOT LIKE GREEN EGGS AND HAM! I DO NOT LIKE THEM, SAM-I-AM. YOU DO NOT LIKE THEM. SO YOU SAY. TRY THEM! TRY THEM! AND YOU MAY. TRY THEM AND YOU MAY, I SAY. SAM! IF YOU LET ME BE, I WILL TRY THEM. YOU WILL SEE. SAY! I LIKE GREEN EGGS AND HAM! I DO! I LIKE THEM, SAM-I-AM! AND I WOULD EAT THEM IN A BOAT. AND I WOULD EAT THEM WITH A GOAT... AND I WILL EAT THEM, IN THE RAIN. AND IN THE DARK. AND ON A TRAIN. AND IN A CAR. AND IN A TREE. THEY ARE SO GOOD, SO GOOD, YOU SEE! SO I WILL EAT THEM IN A BOX. AND I WILL EAT THEM WITH A FOX. AND I WILL EAT THEM IN A HOUSE. AND I WILL EAT THEM WITH A MOUSE. AND I WILL EAT THEM HERE AND THERE. SAY! I WILL EAT THEM ANYWHERE! I DO SO LIKE GREEN EGGS AND HAM! THANK YOU! THANK YOU, SAM-I-AM.

Output:

(S)election Sort

(Q)uick Sort

(E)xit

Enter choice: Q

A : 56 frequency.

AM : 2 frequency.

AND : 25 frequency.

ANYWHERE! : 3 frequency.

ANYWHERE. : 5 frequency.

ARE : 1 frequency.

ARE. : 1 frequency.

BE! : 2 frequency.

BE, : 1 frequency.

BE. : 1 frequency.

BOAT. : 2 frequency.

BOAT? : 1 frequency.

BOX. : 6 frequency.

BOX? : 1 frequency.

CAR! : 3 frequency.

CAR. : 3 frequency.

CAR? : 1 frequency.

COULD : 14 frequency.

DARK! : 2 frequency.

DARK. : 3 frequency.

DARK? : 2 frequency.

DO : 36 frequency.

DO! : 1 frequency.

EAT : 23 frequency.

EGGS : 11 frequency.

FOX. : 6 frequency.

FOX? : 1 frequency.

GOAT! : 1 frequency.

GOAT. : 1 frequency.

GOAT... : 1 frequency.

GOAT? : 1 frequency.

GOOD, : 2 frequency.

GREEM : 1 frequency.

GREEN : 10 frequency.

HAM! : 3 frequency.

HAM. : 6 frequency.

HAM? : 2 frequency.

HERE : 11 frequency.

HOUSE. : 7 frequency.

HOUSE? : 1 frequency.

I : 69 frequency.

IF : 1 frequency.

IN : 40 frequency.

LET : 4 frequency.

LIKE : 44 frequency.

MAY : 2 frequency.

MAY, : 1 frequency.

MAY. : 1 frequency.

ME : 4 frequency.

MOUSE. : 6 frequency.

MOUSE? : 1 frequency.

NOT : 67 frequency.

NOT, : 15 frequency.

ON : 6 frequency.

OR : 8 frequency.

RAIN. : 3 frequency.

RAIN? : 1 frequency.

SAM! : 2 frequency.

SAM, : 1 frequency.

SAM-I-AM! : 4 frequency.

SAM-I-AM. : 9 frequency.

SAM. : 2 frequency.

SAY! : 3 frequency.

SAY. : 2 frequency.

SEE! : 1 frequency.

SEE. : 3 frequency.

SO : 5 frequency.

THANK : 2 frequency.

THAT : 3 frequency.

THE : 11 frequency.

THEM : 40 frequency.

THEM! : 4 frequency.

THEM, : 10 frequency.

THEM,SAM-I-AM. : 1 frequency.

THEM. : 3 frequency.

THEN : 1 frequency.

THERE. : 8 frequency.

THERE? : 1 frequency.

THEY : 2 frequency.

TRAIN! : 5 frequency.

TRAIN. : 2 frequency.

TRAIN? : 1 frequency.

TREE! : 3 frequency.

TREE. : 3 frequency.

TRY : 4 frequency.

WILL : 18 frequency.

WITH : 18 frequency.

WOULD : 27 frequency.

YOU : 23 frequency.

YOU! : 1 frequency.

YOU, : 8 frequency.

YOU? : 2 frequency.

Quicksort finished in 12000 steps.

Hints:

Note that depending on implementation the number of steps you will have is different from others.

Use appropriate software design techniques, and implement the class methods with Java constructs for I/O, declarations, and calculations.

Build your program in steps (i.e., get the input and output working, then add the functions, etc.). Emphasize functionality first, then add the advanced features.

data:

Remember that you must pass the data file name in as a command line argument.

In: Computer Science

What are some of the potential sources of risk in a systems analysis and design project?...

What are some of the potential sources of risk in a systems analysis and design project? How does the project manager cope with these risks throughout the duration of the project?

In: Computer Science

Using a vector of integers that you define. Write a C++ program to run a menu...

Using a vector of integers that you define.

Write a C++ program to run a menu driven program with the following choices:

1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit

Make sure your program conforms to the following requirements:

2. Write a function called getValidAge that allows a user to enter in an integer and loops until a valid number that is >= 0 and < 120 is entered. It returns the valid age. (5 points).

3. Write a function called displayAges that takes in a vector of integers as a parameter and displays the ages in the format in the sample run below. (10 points).

4. Write a function called AddAge that takes in a vector of integers by reference as a parameter, asks the user to input a valid age, and adds it to the vector of integers . (15 points).

5. Write a function called getAverageAge that takes in a vector of integers as a parameter, computes, and returns the average age. (15 points).

6. Write a function called getYoungestAge that takes in a vector of integers as a parameter, computes, and returns the youngest age. (15 points).

7. Write a function called getNumStudentsVote that takes in a vector of integers as a parameter, computes, and returns the number of ages in the vector that are >= 18. (15 points).

8. Write a function called RemoveStudentsLessThanSelectedAge that takes in a vector of integers as a parameter, asks the user for an age, creates a new vector of integers that only contains the ages in the parameter vector which are >= the age selected by the user and returns the new vector. (20 points).

9. Add comments wherever necessary. (5 points)

NOTE: You must take care of the case when the vector is empty and an operation is being performed on it. In such cases the program should display a 0 for the given result.

Sample Runs:

NOTE: not all possible runs are shown below.

Welcome to the students age in class program!
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:

1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..3
Average age = 0
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..4
Youngest age = 0
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..5
Number of students who can vote = 0
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..6
Please enter in the age...
5
Students removed
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
4
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
24
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
18
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
12
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:
4 24 18 12
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..3
Average age = 14
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..4
Youngest age = 4
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..5
Number of students who can vote = 2
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..6
Please enter in the age...
15
Students removed
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:
24 18
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..3
Average age = 21
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..4
Youngest age = 18
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..5
Number of students who can vote = 2
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..-8
Select an option (1..7)..8
Select an option (1..7)..1
Student ages:
24 18
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..2
Please enter in the age...
-8
Please enter in a valid age (1-120) ...
130
Please enter in a valid age (1-120) ...
55
Age added
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..1
Student ages:
24 18 55
1) Display the ages
2) Add an age
3) Display the average age
4) Display the youngest age
5) Display the number of students who can vote
6) Remove all students less than a given age
7) Quit
Select an option (1..7)..7

Process finished with exit code 0

In: Computer Science

How is the trend toward open systems and interoperability related to business use of web based...

How is the trend toward open systems and interoperability related to business use of web based systems including Cloud Computing and Software As A Service (SAAS)? Give examples of how different system platforms can use a common standard to communicate with each other. This is very important in the realm of business where not every company is using the same operating system version, file format, telecommunication standard or whatever difference that must be overcome in order to work together.

I understand that you have to search for information from certain resources, but I would like you to write as much as possible in YOUR OWN WORDS.

In: Computer Science

In Python Complete the function powersOf5(). Have the function take a parameter n and return a...

In Python

Complete the function powersOf5(). Have the function take a parameter n and return a list of the first n powers of 5. One way to calculate powers of 5 is by starting with 1 and then multiplying the previous number by 5.

Examples:

powersOf5( 1 ) returns [1]

powersOf5( 2 ) returns [1, 5]

powersOf5( 3 ) returns [1, 5, 25]

powersOf5( 6 ) returns [1, 5, 25, 125, 625, 3125]

powersOf5( 10 ) returns [1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125]

In: Computer Science

Using the provided Java program, complete the code to do the following. You may need to...

Using the provided Java program, complete the code to do the following. You may need to create other data items than what is listed for this assignment.

  1. The changes to the methods are listed in the comments above the method names.
  2. TODO comments exist. Apply any TODO tasks and remove the TODO comments when complete.
  3. Modify the method findMyCurrency() to do the following:

   a. Use a do-while loop

b. Prompt for a currency to find.

c. Inside this loop, call the lookUpCurrency() method can pass the inputted currency code value.

d. The lookUpCurrency() method needs to loop through the list of currencies and compare the passed currency code with the currency code in the array. This method should return a boolean result.

Look at the showCurrencies() method for a example of how to loop for each element.

e. In the findMyCurrency()  method

   If found - Display the currency code and state it was found - i.e. "FJD found !".

   If not found - Display the currency code and not found - i.e " ZZZ not found!".

f. Prompt with "Retry Y/N ?" to try again. If I select N, then exit the loop. Allow any other char to restart the loop and prompt for a currency to find.

Because you are comparing strings, remember to use the .equals method - not ==.

Below is a partial example of the expected output.

Enter a Currency Code to Find: USD

USD found!

Retry Y/N ? Y

Enter a Currency Code to Find: ZZZ

ZZZ not found!

Retry Y/N ? N


import java.util.Currency;
import java.util.Iterator;
import java.util.Set;



public class CheckCurrencyCode {

        
        // Sets the MAX_CURRENCIES value from the Currency Object
        static int MAX_CURRENCIES = Currency.getAvailableCurrencies().size();
        static String[] CURRENCY_CODES = new String[MAX_CURRENCIES];
                        
                        
        /**
         * This method will load the currency_Codes array with 3 char codes.
         * It does not need to change
         */
        
        private static void loadCurrencyCodes() {
                 Set<Currency> currencies = Currency.getAvailableCurrencies();
                 Iterator<Currency> i = currencies.iterator();
                 int idx = 0;
                 while(i.hasNext()) {
                         CURRENCY_CODES[idx++] = i.next().getCurrencyCode();
                 }
        }
        
        /**
         * Raw display of the Currency_codes;
         * Could also use System.out.println(Arrays.toString(CURRENCY_CODES));
         * It does not need to change
         */
        private static void showCurrencies() {
                for (int idx = 0; idx < MAX_CURRENCIES;++idx) {
                        System.out.print(CURRENCY_CODES[idx]+",");
                }
                
                System.out.println();
                //System.out.println(Arrays.toString(CURRENCY_CODES));
        }
        
        
        /**
         * Look up the given currency here and set the return value
         * to true if found or false if not found
         * 
         * Hint: Use a FOR loop to traverse the loop
         * 
         * @param myCurrencyToFind
         * @return
         */
        private static boolean lookUpCurrency(String myCurrencyToFind) {
        
                //TODO remove line below. It was added only for compile purposes
                return true;
        }
        
        /**
         * Prompt for a currency to find
         * Call the lookUpCurrency with the inputted currency code 
         * Display the found result
         * Prompt to try again and exit this method only if the choice is to not continue
         */
        private static void findMyCurrency() {
        
        
        }
        public static void main(String[] args) {
                loadCurrencyCodes();
                showCurrencies();
                findMyCurrency();
                //TODO Display an indication that the program is completed 
                
                                

        }

}

In: Computer Science

Please describe the use of digital payment in your organization and the role of PCI-DSS in...

Please describe the use of digital payment in your organization and the role of PCI-DSS in protecting such transactions. If your organization/workplace does not implement digital payments, suggest a process or avenue to implement it

In: Computer Science

You will create a program that will follow the queuing theory of the Barbershop Problem. You...

You will create a program that will follow the queuing theory of the Barbershop Problem. You will initially create a flow chart for the assignment to be uploaded to the Queuing Theory Flowchart assignment drop box. In this you will use queues and random number generators to complete this project. You will create three queues

  1. Couch - the area where patron will wait just prior to getting their hair cut;
  2. Line - the area where patron will form a line just before reaching the couch; and
  3. Cashier - the area where patrons will line up to pay just before exiting the barbershop and after finishing their haircut.  

You will create a container for the barbers chairs (list) . The wait times for the barbers will be random. Barber one will be the fastest and barber three will be the slowest. Randomize the wait times accordingly.  

The cashier wait times will also vary randomly.

Barber wait times.

  • 1 second (system time) = 5 minutes
  • Max time 2 hours
  • Min time 20 minutes.

Cashier wait time

  • 1 second (system time) = 1 minute
  • Max time 3 minutes
  • Min time 1 minute.

IN PYTHON AND NOT QUIZ

In: Computer Science

Program in Python Problem Statement Write a program with the following functions:  wordCount. This function...

Program in Python

Problem Statement
Write a program with the following functions:
 wordCount. This function should accept a string as a parameter and return the
number of words contained in the string.
 mostFrequentWord. This function accepts a string as a parameter and returns the
word that occurs the most frequently in the string.
 replaceWord. This function accepts three strings as parameters, let’s call them
string1, string2, and string3. It searches string1 for all occurrences of string2. When it finds an occurrence of string2, it replaces it with string3.
For example, suppose the three parameters have the following values:
string1: string2: string3:
“the cat jumped up to reach the ball” “the”
“that”
With these three, the function would return a string with the value “that cat jumped up to reach that ball”
In the main function, ask the user to enter a sentence, and demonstrate each of the above functions.

Sample Output
Enter a sentence: the cat jumped up to reach the ball There are 8 words in the sentence
The most frequent word in the sentence is: the
Enter oldString, then newString you want to replace, separate them with a space: the that The new sentence after replacement is: that cat jumped up to reach that ball

In: Computer Science