Questions
8,2,10,10,8,10,2,8,,8,10,2,8,1,1,8 Trace the above using (3 way partitioning) quick sort java

8,2,10,10,8,10,2,8,,8,10,2,8,1,1,8

Trace the above using (3 way partitioning) quick sort java

In: Computer Science

Write python code so that in a game of hangman the word ‘apple’ is displayed as...

Write python code so that in a game of hangman the word ‘apple’ is displayed as
“ _ _ _ _ _ “
and is usable code for any random words. Include in this code how to after the player has guessed a correct letter replace the _ with the correct guess shown as
“ _ p _ _ _”

In: Computer Science

Using C: Implement function types that takes no input, declares 3 variables of type char, 3...

Using C:

Implement function types that takes no input, declares 3 variables of type char, 3 of type short, 3 of type int, and 3 of type double---in that order---and prints the addresses of the 12 variables---in the same order---in both hex (use %p conversion instruction) and unsigned long format.

&a1 = 0x7ffd45e3ac0f, 140725776002063
&a2 = 0x7ffd45e3ac0e, 140725776002062
&a3 = 0x7ffd45e3ac0d, 140725776002061
&b1 = 0x7ffd45e3ac0a, 140725776002058
&b2 = 0x7ffd45e3ac08, 140725776002056
...

In: Computer Science

Python program A number game machine consists of three rotating disks labelled with the numbers 0...

Python program

A number game machine consists of three rotating disks labelled with the numbers 0 to 9 (inclusive). If certain combinations of numbers appear when the disks stop moving, the player wins the game.

The player wins if

  • the first and third numbers are the same, and the second number is less than 5, or
  • all three numbers are the same, or
  • the sum of the first two numbers is greater than the third number;

otherwise the player loses.

Write a Python program to simulate this number game by randomly generating 3 integer values between 0 and 9 (inclusive), and printing whether the player has won or lost the game.

To randomly generate a number between and including 0 and 9, use the randintmethod from random library module. For example, x = random.randint(1,100)will automatically generate a random integer between 1 and 100 (inclusive) and store it in x.

Sample output 1:

Random numbers: 2 3 5
You lose.

Sample output 2:

Random numbers: 7 7 0
You win!

In: Computer Science

create a menu in Java. A menu is a presentation of options for you to select....

create a menu in Java. A menu is a presentation of options for you to select. The article above that is in our discussion board may be helpful.

You can do this in the main() method.

1. Create a String variable named menuChoice.

2. Display 3 options for your program. I recommend using 3 System.out.println statements and a 4th System.out.print to show "Enter your Selection:". This needs to be inside the do -- while loop.

       A. Buy Stock.
       B. Sell Stock
       X. Exit

       Enter your Selection:

3. Prompt for the value menuChoice.

4. If menuChoice is "A", display "Buy Stock" and redisplay the menu.

If menuChoice is "B", display "Sell Stock" and redisplay the menu.

If menuChoice is "X", the loop needs to terminate.

If any other choice is given, display "Invalid selection" and redisplay the menu.

For grading, I will test with uppercase characters. Review section 5.1 for String comparisons.

Convert the menuChoice to an upper case String after input or as part of the input but before any processing is done. This will allow me to enter 'a' but process as 'A'. You can Google for "Java string uppercase" to see how this is done.

For Task 4 - Create 2 void methods - 1 for option A to call, and another for option B to call. Do the display work only inside these methods and call these methods for these options.

In: Computer Science

Write a JavaFX application that draws 5 squares. Use a random number generator to generate random...

Write a JavaFX application that draws 5 squares. Use a random number generator to generate random values for the size, x, and y. Make the size between 100 and 200, x between 0 and 600, y between 0 and 400. You can pick any color, but you must use different colors for the 5 squares. Set your window to 600 by 400.

In: Computer Science

Using C: Implement four versions of a function funSum that takes a positive integer n as...

Using C:

Implement four versions of a function funSum that takes a positive integer n as input and returns the sum of all integers up to and including n that are divisible by 6 or 7: using a for loop in funSum1, using a while loop in funSum2, using a do-while loop in funSum3, and using recursion in funSum4. Your output for the included test code should be:

funSum1(20) = 57
funSum2(20) = 57
funSum3(20) = 57
funSum4(20) = 57

In: Computer Science

Look at the C code below. Identify the statements that contain a syntax error OR logical...

Look at the C code below. Identify the statements that contain a syntax error OR logical error. Evaluate each statement as if all previous statements are correct. Select all that apply

                #include <stdio>

                Int main()

                {

                                Float webbing;

                                Puts(“Please enter the amount of webbing per cartridge: “)

                                Scanf(“%f”, webbing);

                                Printf(“You entered: “+ webbing + “\n”);

                                Return 0;

                }

Answers:

                Including the library for I/O

                Declaring a variable

                Writing output to the console using puts

                Getting input from the console

                Writing output to the console using printf

In: Computer Science

PYTHON (Game: Tic-tac-toe): Write a program that plays the tic-tac-toe game. Two players take turns clicking...

PYTHON

(Game: Tic-tac-toe): Write a program that plays the tic-tac-toe game. Two players take turns clicking an available cell in a 3 x 3 grid with their respective tokens (either X or O). When one player has placed three tokens in a horizontal, vertical, or diagonal row on the grid, the game is over and that player has won. A draw (no winner) occurs when all the cells in the grid have been filled with tokens and neither player has achieved a win.

In: Computer Science

Show a trace of the recursive descent parser given in section 4.4.1 for the string b...

Show a trace of the recursive descent parser given in section 4.4.1 for the string b * (a * b) * a of Sebesta

In: Computer Science

Activity 1 – Using Netcat to Run Commands on Another Box Fire up a virtual box...

Activity 1 – Using Netcat to Run Commands on Another Box

  1. Fire up a virtual box guest OS. Install netcat if necessary (or if in Windows, check out netcat for windows or ncat from the maker of nmap). Start netcat in listener mode tying it to a command shell (see CHR chapter 8). Some versions of netcat can’t run commands, in which case you might need to install netcat-traditional
  2. From another box (your host machine or another VM), initiate a netcat connection to you’re the box you set up in Step 1.
  3. You should now have command prompt access (i.e. shell access). Type in a few commands (e.g. “dir” in Windows or “ls” in Linux) and document that what you type in one box affects the other box (i.e. that those commands are executed on the other box).
  4. Take a screenshot of BOTH windows side-by-side or ask Dr. V to validate your setup.

Activity 2 – Intro to Putty SSH

  1. Use instructions on next page to activate your Krypton account & set a new password.
  2. Log in (in Putty or SSH client) on the Krypton (Unix) system.
  3. Use Putty to create an encrypted tunnel (MAC users, use command-line SSH client) to mnsu.edu using source port 5555.
  4. Edit your connection in your internet browser so that when you connect to 127.0.0.1:5555 you are sent to mnsu.edu through the tunnel.
  5. Start Wireshark and sniff the packets that belong to your machine.
  6. Open the newly configured browser and go to 127.0.0.1.
  7. Document (i.e. PROVE) with Wireshark that the traffic is NOT being sent in plaintext directly to mnsu.edu but is instead being sent via the encrypted tunnel.

Note: you may still see some plaintext traffic (between your browser & your SSH client), but you should not be able to see any plaintext traffic going directly to mnsu.edu.

(hint: look for (i.e. filter) traffic going to the IP address of the mnsu.edu webserver)

      7.   Take appropriate screenshots to support your argument or have Dr. V verify it.

In: Computer Science

Write a program named Intervals.java that will take two time intervals (a starting and ending time)...

Write a program named Intervals.java that will take two time intervals (a starting and ending time) and compare them. The program first prompts the user for an earlier and later interval. Each interval consists of two numbers in 24-hour format (for example, 1507 for 3:07 p.m.):

Enter earlier start and end time as two 24-hour format times: 0700 1045
Enter later start and end time as two 24-hour format times: 0815 1130

You may presume that the user will enter the intervals with the start time and end time in the correct order.

The program will then calculate how many minutes are in each interval, which one is longer, and whether the intervals overlap (does the later interval start before the first one is finished):

The earlier interval is 225 minutes long.
The later interval is 195 minutes long.
The earlier interval is longer.
These intervals overlap.

Here is output from another run of the program:

Enter earlier start and end time as two 24-hour format times: 1340 1445
Enter later start and end time as two 24-hour format times: 1500 1710
The earlier interval is 65 minutes long.
The later interval is 130 minutes long.
The later interval is longer.
These intervals do not overlap.

If the intervals are of equal length, your output should say they are equally long. If the later interval starts at the same time that the earlier interval ends, they do not overlap.

Plan this program before you start writing it! No single part of this program is tremendously difficult, but there are many parts.

Hint: Convert the times to number of minutes after midnight. This will make your calculations much easier. For example, 0507 is 5 hours and 7 minutes past midnight, or 307 minutes past midnight. You will want to use / and % with 100 to split up the time into the hours and minutes part, but use 60 when calculating total minutes!

Extra challenge: Give the correct answer even if the user enters the beginning and end times for an interval in the wrong order, or if they enter the later interval first and the earlier interval second.

In: Computer Science

5. Write a CH program that takes the marks of a student as input and prints...

5. Write a CH program that takes the marks of a student as input and prints the grade on screen according to the following criteria: CRITERIA LESS THAN 60 GREATER THAN 60 BUT LESS THAN 65 GREATER THAN 65 BUT LESS THAN 70 GREATER THAN 70 BUT LESS THAN 75 GREATER THAN 75 BUT LESS THAN 80 GREATER THAN 80 BUT LESS THAN 85 GREATER THAN 85 BUT LESS THAN 90 GREATER THAN 90 GRADE F D D+ с C+ B B+ A

https://www.chegg.com/homework-help/questions-and-answers/5-write-ch-program-takes-marks-student-input-prints-grade-screen-according-following-crite-q58688769

In: Computer Science

Explain the implications of Management Information Systems on the Ecommerce industry.

Explain the implications of Management Information Systems on the Ecommerce industry.

In: Computer Science

Networking Why is wireless transmission dangerous? Why is 802.1X needed?

Networking

  1. Why is wireless transmission dangerous?
  2. Why is 802.1X needed?

In: Computer Science