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
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. 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 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 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 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 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 * (a * b) * a of Sebesta
In: Computer Science
Activity 1 – Using Netcat to Run Commands on Another Box
Activity 2 – Intro to Putty SSH
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) 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 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.
In: Computer Science
Networking
In: Computer Science
Compare the language generated by Grammar #2 to the language generated by Grammar #1. How do the two languages compare to each other? (Is one language a proper subset of the other? Does each language contain a string that the other one does not? Do both grammars generate the very same language?)
grammar #1 where S is the start symbol
S → tV | iC | iV | i
C → tV
V → iC | iV | i
Grammar #2 where S is the start symbol
S → W
W → YW | Y
Y → CV | V
C → t
V → i
In: Computer Science
Assignment Specifications Background You are recently employed as a business analyst at Adam & Co, a Perth-based wholesaler of industrial supplies. Adam & Co sources its inventories from manufacturers in China, Thailand and Vietnam. The company has a centralised accounting system with networked terminals at different locations. Adam & Co’s expenditure cycle procedures are described as follow:
Purchases System
The process begins when the purchasing clerk checks the inventory subsidiary ledger at his/her computer terminal each morning. When the quantity of an item is deemed to be too low, the clerk selects a vendor from the valid vendor file and prepares a digital purchase order. The clerk prints two hard copies: one copy is sent to the vendor, and the other is filed in the purchasing department. Digital purchase order record is added to the purchase order file. When the goods arrive in the receiving department, the receiving clerk inspects them and reconciles the items against the information in the digital purchase order and the packing slip. The clerk then manually prepares two hard copies of the receiving reports. One of these accompanies the goods to the inventory warehouse, where the clerks shelves the goods and updates the inventory subsidiary ledger from his/her computer terminal. The clerk then files the receiving report in the department. The other copy of the receiving report is sent to the accounts payable department, where the accounts payable clerk files it until the supplier’s invoice arrives. When the accounts payable clerk receives the invoice he pull the receiving report from the temporary file, prints a hard copy of the digital purchase order, and reconcilesthe three documents. At this time, the clerk updates the digital accounts payable subsidiary ledger, the accounts payable control account and the inventory control account in the general ledger from his terminal. The clerk then sends the invoice, receiving report, and the purchase order copy to the cash disbursement department.
Cash Disbursements System
Upon the receipt of the documents from the accounts payable department, the cash disbursements clerk files the documents until their payment due date. On the due date, the clerk prepares a cheque for the invoiced account, when is sent to the treasurer who sign it and mail the cheque to the vendor. The cash disbursements clerk then updates the cheque register, accounts payable subsidiary ledger, and the accounts payable control account from his/her computer terminal. Finally, the receiving clerk files the invoice, purchase order copy, receiving report, and cheque copy in the department.
Payroll System
Adam & Co’s employees record their hours worked on time cards every day. Their supervisors review the time cards for correctness and submit them to the payroll department at the end of each week. Using a computer terminal connected to the central payroll system, which is located in the data processing department, the payroll clerk inputs the time card data, prints hard copies of the pay cheques, print two copies of the payroll register, and posts to digital employee records. The payroll clerk files the time cards in the payroll department and sends the employee pay cheques to the various supervisors for review and distribution to their respective department employees. The payroll clerk then sends one copy of the payroll register to the accounts payable department, and files the other with the time cards in the payroll department. Page 3 of 5 HA2042 Accounting Information Systems Individual Assignment The accounts payable clerk reviews the payroll register and manually prepares a disbursement voucher. The clerk sends the voucher and the payroll register to the general ledger department. The accounts payable clerk then writes a cheque for the entire payroll and deposits it in the imprest account at the bank. Finally the clerk files a copy of the cheque in the accounts payable department. Once the general ledger clerk receives the voucher and payroll register, the clerk posts to the general ledger from the department computer terminal and files the voucher and payroll register in the department.
required
System flowchart of payroll system??
In: Computer Science
Find a news article concerning a hacked website. Post a link, and summarize the article in your own words. (1-2 paragraphs)
Second question: You are hacking a website or application. Give a brief description of your attack scenario.
In: Computer Science