2_ob85_meet
.docx
keyboard_arrow_up
School
Drexel University *
*We aren’t endorsed by this school
Course
431
Subject
Computer Science
Date
May 1, 2024
Type
docx
Pages
4
Uploaded by bbbtobi17 on coursehero.com
Tobi Bakare 04/13/2024
Week2Meet - 10 pts
===============================
Reading a program
Write pseudocode for the GenerateCode program.
/***************************************
* GenerateCode.java – name of the program * random passphrase program – the aim of the program
* * @author Tammy Pirmann – author * @version 1.0 – version of the coder
****************************************/
import java.util.Scanner; - importing class scanner used to get user input, import java.util.Random; - importing random generator
class GenerateCode { - - class name ( must be the same as the name of file)
public static void main (String args[]){- the main method used to run a program Random randGen = new Random(); - create a new random instance
Scanner keyboard = new Scanner(System.in); - create scanner object “keyboard” to read input
System.out.println("Welcome to the Code Generator! \n Answer some questions and I will generate a set of codes for your consideration."); -
print out the phrase System.out.println("The name of a loved one: "); -
print out the phrase String lovedOne = keyboard.next(); - asking for an input keyboard.nextLine(); - moving the input to the next line.
… ….
keyboard.close(); - close scanner object keyboard
int number = (randGen.nextInt(8))+2;
String shortFvrt = favorite.replace('a', ' '); -
replaces the
favorite food vowel with a space, in this case the vowel ‘a’
shortFvrt = shortFvrt.replace(" ", ""); - replaces the favorite food space with no space.
… ….
System.out.printf("Code #1: %s%d%s\n", lovedOne, year, shortFvrt); -
print out the random phrase in this order with three of the inputs
… ….
System.out.printf("Code #3: %s%d%s%d\n", lovedOne, number, place, year); - print out the random phrase in this order with four of the inputs
… ….
}
}
---------------------------------------------------------------------------------------------------------------------
------
I understand the problem introduced in class to be: (in your own words)
The problem introduced in class was aimed to generate random phrases from common words we like and know while also learning how to use int, replace and random number. This phrase could be useful in creating passwords also. My plan to solve this problem is: to get input for each part of the random phrase and put them together.
The solution to the problem was the following program: (provide the name of the .java file only)
GenerateCode.java
I tested the solution with at least 3 different value sets. The test data and results are:
(use this format: var1 = data, var2 = data, etc -> result)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Labels A, B, C and D represent the operations that occur in a CPU as photos given. Name the operation for Label A, B, C and D. (in essay)
arrow_forward
Which of the following steps must be completed for a computer program to be constructed and executed?
None of the other choices.
All of the other choices (except "None of the other choices")
A computer program is loaded from storage device into RAM and the CPU "jumps to" (begins executing) the first instruction
A computer program is written in a high-level language and saved as a plain-text file.
A computer program is combined with (a.k.a. linked) with other previously written and compiled code the program depends on, called libraries
A computer program is compiled into machine instructions in binary code
arrow_forward
new student Julie just received her student id 30099512. She figured out a way to memorize the last 5 digits as that's her sister's birthday! Julie leveraged
A) memory for arbitrary things
B) memory for prospetive activities
C) memory in multiple minds
D) memory for meaningful things
E) none of the above
arrow_forward
Create a MATLAB program for a local convenience store.
Store Items:
- Apples 30pcs ($2)
-Oranges 30pcs ($3)
-Grapes 50pcs ($4)
-Watermelons 10pcs ($5)
What the program should include:
-Store Menu containing (item name, item quantity, and price)
-Checkout option (able to calculate change from a purchase)
-Update on Store Menu (deduction on purchased items from the store's inventory
(code should include working inventory system or the answer will be declined).
arrow_forward
Preffered language is java. Will be compiled with intellij. Need a solution for each part 1-5. Is it possible to get it all in 1 code?
Problem 1 consists of multiple parts. You should finish one part and ensure that it works before moving to the next part. You will need to refactor (rewrite parts of) your code as you move between parts.
Part 1
The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use a SecureRandom object to produce two positive one-digit integers (you will need to look up how to do this). The program should then prompt the user with a question, such as
How much is 6 times 7?
The student then inputs the answer. Next, the program checks the student’s answer. If it’s correct, display the message "Very good!" and ask another multiplication question. If the answer is wrong, display the message "No. Please try again.>again." and let the student try the…
arrow_forward
238.
Program execution are used to
a.
Execute Programs
b.
Write Programs
c.
Control Programs
d.
Read Programs
arrow_forward
A(n) is a collection of instructions followed by a computer to do a job.
arrow_forward
this is a Microprocessors homework question
help please
arrow_forward
A problem’s will answer the question What information will the computer need to know to display, print, or store the output items?
a. input
b. output
c. processing
d. purpose
arrow_forward
OS ASSEMBLY CODE
Using YASM assembly code(x86)
.Create a program that accepts two user input. For any input from the two users, return True or false
Example:
Is today Friday ?
UserA: True
UserB: False
UserA is Wrong
UserB is Correct
arrow_forward
Course: Lab Architecture Computer2. What do this code do? module p ( a, b, r, w) input a, b; output r, w; assign r= a ^ b; assign w= a & b; end endmodule
arrow_forward
What components within a computer are necessary for its operation? The argument falls short.
arrow_forward
2 ________________is a program that manages the computer hardware
a.
Operating system
b.
RAM
c.
Word
d.
Memory
Just answer without explanation please
arrow_forward
Question 1 ( 50 points) Write a Pep/9 Assembly language program that takes a number from input, then adds 25 to the input value. The output should look exactly like below: Input 20 Output 20+25=45
arrow_forward
The field of study known as computer science examines computers. What kinds of things do you want to develop in your career as a scientist in the years to come? Is there a purpose behind your desire to bring it into existence?
arrow_forward
Today's computer code types? Summarise each.
arrow_forward
117.
A person who writes a programme for running the hardware of a computer is called
a.
programmer
b.
data processor
c.
system analyst
d.
system designer
arrow_forward
Pleas answer this question in short vesion dont copy paste
What is an opcode and which information is stored inside an opcode? What are the different ways to represent values and variables?
arrow_forward
construct the program for our imaginary computer!
There must be made of at least 5 instructions
There should be at least 3 different types of instructions (write, move, decrement, add, or)
arrow_forward
Which of the following is an example of memory recognition?
1. Answering fill-in-the-bank test questions
2. Answering multiple choice test questions
3. Remembering the name of your first-grade teacher
4. Studying first semester notes for the final exam
5. Brushing up on multiplication times tables
arrow_forward
Microprocessor
1] write a program to check given number is even or odd.
arrow_forward
Composer is used to convert complex programs into simpler ones. The compiler may affect how fast a computer's central processing unit works. That may be a possibility, so why not think about it? But the question of how to react to it persists. If you believe you know the solution, please explain why.
arrow_forward
Today's computer code types? Summarize each.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- Labels A, B, C and D represent the operations that occur in a CPU as photos given. Name the operation for Label A, B, C and D. (in essay)arrow_forwardWhich of the following steps must be completed for a computer program to be constructed and executed? None of the other choices. All of the other choices (except "None of the other choices") A computer program is loaded from storage device into RAM and the CPU "jumps to" (begins executing) the first instruction A computer program is written in a high-level language and saved as a plain-text file. A computer program is combined with (a.k.a. linked) with other previously written and compiled code the program depends on, called libraries A computer program is compiled into machine instructions in binary codearrow_forwardnew student Julie just received her student id 30099512. She figured out a way to memorize the last 5 digits as that's her sister's birthday! Julie leveraged A) memory for arbitrary things B) memory for prospetive activities C) memory in multiple minds D) memory for meaningful things E) none of the abovearrow_forward
- Create a MATLAB program for a local convenience store. Store Items: - Apples 30pcs ($2) -Oranges 30pcs ($3) -Grapes 50pcs ($4) -Watermelons 10pcs ($5) What the program should include: -Store Menu containing (item name, item quantity, and price) -Checkout option (able to calculate change from a purchase) -Update on Store Menu (deduction on purchased items from the store's inventory (code should include working inventory system or the answer will be declined).arrow_forwardPreffered language is java. Will be compiled with intellij. Need a solution for each part 1-5. Is it possible to get it all in 1 code? Problem 1 consists of multiple parts. You should finish one part and ensure that it works before moving to the next part. You will need to refactor (rewrite parts of) your code as you move between parts. Part 1 The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use a SecureRandom object to produce two positive one-digit integers (you will need to look up how to do this). The program should then prompt the user with a question, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the student’s answer. If it’s correct, display the message "Very good!" and ask another multiplication question. If the answer is wrong, display the message "No. Please try again.>again." and let the student try the…arrow_forward238. Program execution are used to a. Execute Programs b. Write Programs c. Control Programs d. Read Programsarrow_forward
- A(n) is a collection of instructions followed by a computer to do a job.arrow_forwardthis is a Microprocessors homework question help pleasearrow_forwardA problem’s will answer the question What information will the computer need to know to display, print, or store the output items? a. input b. output c. processing d. purposearrow_forward
- OS ASSEMBLY CODE Using YASM assembly code(x86) .Create a program that accepts two user input. For any input from the two users, return True or false Example: Is today Friday ? UserA: True UserB: False UserA is Wrong UserB is Correctarrow_forwardCourse: Lab Architecture Computer2. What do this code do? module p ( a, b, r, w) input a, b; output r, w; assign r= a ^ b; assign w= a & b; end endmodulearrow_forwardWhat components within a computer are necessary for its operation? The argument falls short.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning