3_ob85_meet
.docx
keyboard_arrow_up
School
Drexel University *
*We aren’t endorsed by this school
Course
540
Subject
Computer Science
Date
May 1, 2024
Type
docx
Pages
4
Uploaded by bbbtobi17 on coursehero.com
Tobi Bakare
04/19/2024
Week3Meet - 10 pts
Turn in on BBL as soon as complete, but before end of day Sunday following the lecture.
===============================
Reading a program
Read both programs. Be the computer and trace which line of code is executing in order. Keep track of what the current state of each variable is.
import java.util.Scanner;
/**********************************
* PuzzlePage.java
* Creates word puzzles for the Triangle
* @author Tammy Pirmann
* @version 20210407
*********************************/
public class PuzzlePage {
public static void main(String args[]){
Scanner keyboard = new Scanner(System.in);
WordScramble puzzle = new WordScramble();
System.out.print("Enter the solution word: ");
String solution = keyboard.nextLine();
System.out.printf("Your puzzle is: %s", puzzle.scramble(solution));
}
}
/*******************************
* WordScramble.java, Scrambles a given word
* @author Tammy Pirmann
* @version 20210407
*******************************/
public class WordScramble { private String solution;
//constructor
public WordScramble() {
solution = "NA";
}
//Setter
public void setSolution(String str){
solution = str.toUpperCase();
}
//Scrambles the solution String
public String scramble(String str){
setSolution(str);
String mix;
int a = solution.indexOf("A");
if (a >= 0) {
mix = solution.substring(a).concat(solution.substring(0,a));
}
int e = solution.indexOf("E");
if (e >= 0) {
mix = solution.substring(e).concat(solution.substring(0,e));
}
int i = solution.indexOf("I");
if (i >= 0) {
mix = solution.substring(i).concat(solution.substring(0,i));
}
int oh = solution.indexOf("O");
if (oh >= 0) {
mix = solution.substring(oh).concat(solution.substring(0,oh));
}
int u = solution.indexOf("U");
if (u >= 0) {
mix = solution.substring(u).concat(solution.substring(0,u));
}
//reverse it in case it still looks like the original word
return reverse(mix); }
//helper method to reverse the scrambled string
private String reverse(String str){
//base case
if (str.isEmpty()){
return str;
}
//Recursive call
return reverseString(str.substring(1)) + str.charAt(0);
}
}
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
Assembly language 64-bit code
The program will prompt the user for their name and then say hello to them using their name. For example, the interactive console of Repl.it might look like:
> bash main.shEnter your name: *Camila *Hello, Camila>
You will not have a library of routines to call upon for the printing and reading. You are manufacturing the complete setup and syscall.
After you complete the reading, remember that .bss is for your variables that will receive data and .data is for fixed information, like prompts.
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
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
Safari File Edit View History Bookmarks Window Help
= zyBooks
My library > CS 11: Introduction to Computer Science- C++ home >
1.19: LAB: Input and formatted output: Right-facing arrow
1.19 LAB: Input and formatted output: Right-facing arrow
Given two input integers for an arrow body and arrowhead (respectively), print a right-facing arrow.
Ex: If the input is:
01
the output is:
1
11
00000111
000001111
00000111
11
1
497630.3807866.qx3zqy7
LAB
ACTIVITY
learn.zybooks.com
1.19.1: LAB: Input and formatted output: Right-facing arrow
1 #include
2 using namespace std;
3
4 int main() {
5
6
7
8
9
10
11 }
int baseDigit;
int headDigit;
/* Type your code here. *,
return 0;
EzyBooks catalog
main.cpp
:i
0/10
((
Load default template...
Ơ
80
Fri Oct 13 3:27 AM
Help/FAQ kimberly sandoval
arrow_forward
True or False
1/ An arithmetic mean is an appropriate measure if the sum of all the measurements is a meaningful and interesting value.
2/ One of the benchmark principle is that it is a program written in a low-level language.
3/ Amdahl's law deals with the potential speedup of a program using multiple processors compared to a single processor.
arrow_forward
a ng.cengage.com
Mind Tap Ce
1 Fall CS111.ONL02.Computer Science...
CENGAGE MINDTAP
egramming Exercise 1.6
Instructions
circle.py
1 radius
float (input('5:')
2 area 3.14 * (5 *5)
Write and test a program that
3
computes the area of a circle.
1. Request a number
representing a radius as
input from the user.
2. Use the formula 3.14 x
radius? to compute the
area.
3. Output this result with a
suitable label.
An example of the program
input and output is shown
below:
Enter the radius: 5
The area is 78.5 square u
nits.
The input value should not be
limited to whole numbers
SEP
14
arrow_forward
San Pedro Belize Express has become the leading mode of transportation to Caye Caulker
and San Pedro and neighboring islands. The changes in travel restrictions and tracking due to
the Covid 19 has placed a demand on the company to keep better records of their
passengers.
The Company is wanting a secure ticketing system capable of keeping important and relevant
information from their customers
Create a python program that allows only authorized user to log into the system for ticketing
transactions and customer information queries
The program will accept names, phone number and SSID from User, Destination before
printing tickets granting them access to board the boat
The program should be able to print all customer and destination and price paid for
tickets(eacher customer records should be printed on different line in a list format/ table
format)
Destination,
San Pedro,
Name,
ID#
Fee
John Doe
2133
25
Billy Jean
Ricky Martin Caye Chapel 1322
Caye Caulker 3345
30
18.50
The program will…
arrow_forward
Progress (60%)
Item 6/10
Time Left: 14:28
It's a text file that contains sequences of zeroes and ones
What is the best definition of a script?
It's an error message generated by the interpreter
It's an error message generated by the compiler
It's a text file that contains instructions which make up a Python program
+ Prev
Next >
arrow_forward
University of Basra
Asiacell I.
COMPUTER_BASRA
Posts
computer_basra
neering
Since 1997
What is this flow chart stand for?
(2) uha
Start
Computers are electronie devices that
Read
diytal
C-A-B
Prist C
(2)
Prien B/
hist A
The computer system consists of:
End
(2) u
What is the result of (x) after executing this program?
(2)
winclude jostream using namespace std;
int main O
Wi feeC
ক
int xa.b.c; a-6;
b-7:
Sat R ia -2 20034
e- 13;
o dd t
couts"x: "ox: returm 0.
dale!
31 likes
. اسئلة امتحان المد ل لمرحلة الأولی computer_basra
سهلة ام صعبة ؟
#مهندس جامعة_الكرمه جامعات_البصرة #هندسة
arrow_forward
SWE 431: Security
General Guidelines
A project group can consist of at most 5 individuals.
Option 1
Implement the RSA in your preferred programming language
For Java,the packages java.math.BigInteger and java.security.SecureRandom should be used. For other
languages, you are responsible to use similar packages.
Source code must be well documented (comments).
The prime numbers p and q should be at least 1024-bit.
The difference of two primes should be bigger than 2512 (for security).
A demonstration of encrypting a message (big mumber) and decrypting the ciphertext (big number)
should be given.
Your program should also include the encryption and decryption timing.
The public key component e must be set to be 65537.
Submit your program and a readme.txt (instructions on how to compile and run your program) to the
elearning dropbox.
arrow_forward
| ZV1O
= السؤال
The memory that directly communicate
with CPU is called auxiliary mamory.
true
false
حفظ الاجابة
arrow_forward
Python code, the code that I have is wrong. I am getting a error "'relative_error' is inaccurate"
arrow_forward
201.
Program execution services use to
a.
Control Program
b.
Delete Program
c.
Execute Program
d.
Update Programs
arrow_forward
A function that writes directly into log of operating system, is
arrow_forward
Branches and Branches
Here is a portion of a program. The initial condition codes have the values N = 0, Z = 1, and P=0.
Consider the values for these codes after the LC-3 executes the sequence of instructions starting at address X384F.
X384F 0101111111100000
X3050 0000100000000001
x3051 | 0000001000000010
x3052 0001000000111111
x3053 0000101000000001
x3054 0001111111101111
Value in condition cell N:
Value in condition cell z:
Value in condition cell P:
arrow_forward
Assembly language
The program will prompt the user for their name and then say hello to them using their name. For example, the interactive console of Repl.it might look like:
> bash main.shEnter your name: *Lauren Cabello*Hello,Lauren Cabello>
You will not have a library of routines to call upon for the printing and reading. You are manufacturing the complete setup and syscall.
After you complete the reading, remember that .bss is for your variables that will receive data and .data is for fixed information, like prompts.
main.asm
section .bss name: resb 32 ; 32 bytes for name
section .data ; YOUR PROMPTS AND LENGTHS HERE
section .textglobal _start
_start:
;; YOUR CODE HERE!;
exit:mov rax, 60 ; exitmov rdi, 0 ; r
arrow_forward
As a BSCS student, do you think it's important for you to learn various computer language?
**maximum 5 sentences
arrow_forward
Determine the output of the following Pep/9 machine-language program when the input typed into the Pep/9 input window is 35
Remember: the left column only shows the memory address of the first byte on the line. Do not copy these memory addresses into the Pep/9 object code
window
0000 D1FC15
0003 F10013
0006 D1FC15
0009 F1FC16
000C D10013
000F F1FC16
0012 00
arrow_forward
Wasit University
Collage of Engineering
Electrical Department
Subject: Computer
Programing I
Class: First Class
2020-2021
Time: 60 min
Q1/Write C++ program to read a score of student and print the estimation to refer it.
е.g:
100 - 90 → Erultant
89 - 80 → Very good
79 – 70 → Good
69 - 60 → Middle
59 - 50 > Ассеpt
49 - 0 → Fail
Q2/ Write a C++ program to find the summation of the odd numbers between 0 and 1000.
BEST OF LUCK
arrow_forward
Due to space and cost constraints, there is *
a unlimited number of registers in a CPU.
O False
O True
*
Information Refers to the symbols that
represent facts, objects, or ideas.
False
O True
ADDRESS BUS It is a unidirectional bus
while DATA BUS is It is a bidirectional bus.
O False
O True
arrow_forward
Implementation Tasks
Overall Requirements
Write two programs encode.toy and decode.toy.
Each TOY instruction must have corresponding pseudocode. (This is auto-generated by Visual X-Toy – see below.) It's also good practice to add line breaks between logically related "sections" of TOY code and write a comment above each "section" explaining what that code does.
encode.toy
Write a TOY program encode.toy to encode a binary message using the scheme described above. Repeatedly read four (4) bits m1, m2, m3, m4 from TOY standard input and write the seven (7) bits m1, m2, m3, m4, p1, p2, p3 to TOY standard output. Stop upon reading FFFF from standard input.
p1 = m1 ^ m2 ^ m4
p2 = m1 ^ m3 ^ m4
p3 = m2 ^ m3 ^ m4
Recall that ^ is the exclusive or operator in Java and TOY. This captures the parity concept described above.
decode.toy
Write a TOY program decode.toy to decode and correct a Hamming encoded message. Repeatedly read seven (7) bits m1, m2, m3, m4, p1, p2, p3 from TOY standard…
arrow_forward
Multitasking is
O a. multiprogramming
O b. sequential
O c. concurrent
O d. timeshare
O e. parallel
arrow_forward
Code in C language. Follow instructions in photo.
Use text provided as input.txt file.
A1, A2
20294 Lorenzana Dr
Woodland Hills, CA
91364
B1, B2
19831 Henshaw St
Culver City, CA
94023
C1, C2
5142 Dumont Pl
Azusa, CA
91112
D1, D2
20636 De Forest St
Woodland Hills, CA
91364
A1, A2
20294 Lorenzana Dr
Woodland Hills, CA
91364
E1, E2
4851 Poe Ave
Woodland Hills, CA
91364
F1, F2
20225 Lorenzana Dr
Los Angeles, CA
91111
G1, G2
20253 Lorenzana Dr
Los Angeles, CA
90005
H1, H2
5241 Del Moreno Dr
Los Angeles, CA
91110
I1, I2
5332 Felice Pl
Stevenson Ranch, CA
94135
J1, J2
5135 Quakertown Ave
Thousand Oaks, CA
91362
K1, K2
720 Eucalyptus Ave 105
Inglewood, CA
89030
L1, L2
5021 Dumont Pl
Woodland Hills, CA
91364
M1, M2
4819 Quedo Pl
Westlake Village, CA
91362
I1, I2
5332 Felice Pl
Stevenson Ranch, CA
94135
I1, I2
5332 Felice Pl
Stevenson Ranch, CA
94135
N1, N2
20044 Wells Dr
Beverly Hills, CA
90210
O1, O2
7659 Mckinley Ave
Los Angeles, CA
90001
arrow_forward
2. First Even Road
by CodeChum Admin
I've been newly assigned as the city's road planner but this job seems tougher than I thought!
Almost all of the roads in this city are uneven. To fix these, I need to find an even road as a reference. Fortunately, the mayor told me that there's 1 even road somewhere and if I persevere, I could find it.
Could you please help me with this?
Instructions:
Your task is to ask the user for the number of rows and columns of a 2D array.
Then, print the row number of the row where the sum of all of its elements is even.
For this problem, it is guaranteed that there is one and only one such row.
Input
1. Number of rows
2. Number of columns
3. Elements of the 2D array
Output
Note that the row number starts at 0, not 1.
Enter·#·of·rows:·3
Enter·#·of·columns:·3
Enter·elements:
2·7·4
1·1·2
0·5·0
Even·row:·1
arrow_forward
2. First Even Road
by CodeChum Admin
I've been newly assigned as the city's road planner but this job seems tougher than I thought!
Almost all of the roads in this city are uneven. To fix these, I need to find an even road as a reference. Fortunately, the mayor told me that there's 1 even road somewhere and if I persevere, I could find it.
Could you please help me with this?
Instructions:
Your task is to ask the user for the number of rows and columns of a 2D array.
Then, print the row number of the row where the sum of all of its elements is even.
For this problem, it is guaranteed that there is one and only one such row.
Input
1. Number of rows
2. Number of columns
3. Elements of the 2D array
Output
Note that the row number starts at 0, not 1.
Enter # of rows: 3
Enter # of columns: 3
Enter elements:
2 7 4
1 1 2
0 5 0
Even row: 1
arrow_forward
The Population Studies Institute monitors the population of the United States. In 2008, this institute wrote a program to create files of the numbers representing populations of the various states, as well as the total population of the United States. This program, which runs on a Motorola processor, projects the population based on various rules, such as the average numbers of births and deaths per year. The institute runs the program and then ships the output files to state agencies so the data values can be used as input into various applications. However, one Pennsylvania agency, running all Intel machines, encountered difficulties, as indicated by the following problem. When the 32-bit unsigned integer 1D2F37E8 (representing the overall U.S. population prediction for 2013) is used as input, and the agency’s program simply outputs this input value, the U.S. population forecast for 2014 is far too large. Can you help this Pennsylvania agency by explaining what might be going wrong?…
arrow_forward
2. First Even Road
by CodeChum Admin
I've been newly assigned as the city's road planner but this job seems tougher than I thought!
Almost all of the roads in this city are uneven. To fix these, I need to find an even road as a reference. Fortunately, the mayor told me that there's 1 even road somewhere and if I persevere, I could find it.
Could you please help me with this?
Instructions:
Your task is to ask the user for the number of rows and columns of a 2D array.
Then, print the row number of the row where the sum of all of its elements is even.
For this problem, it is guaranteed that there is one and only one such row.
Input
1. Number of rows
2. Number of columns
3. Elements of the 2D array
Output
Note that the row number starts at 0, not 1.
arrow_forward
114.
All deadlocks involve conflicting needs for
a.
Resources
b.
Users
c.
Computers
d.
Programs
arrow_forward
Assembly Language x86: (Micro Macro):
templet: .386.model flat, stdcall.stack 4096ExitProcess PROTO, dwExitCode: DWORD.data
day BYTE 0month BYTE 0year WORD 0
.codemain PROC
main ENDPINVOKE ExitProcess, 0END main
Question: What bit string repersents April 1, 2024?
Examples: Date: 00111 (year) 1100 (month) 10010 (day)00111 = 18, 1100 = 12, 10010 = 30, 1980 + 30 = 2010 = 2010 Dec 18mov ax, 00111110010010b; 2010 Dec 10; 30 12 18 DAY:mov dx, ax and dx, 0000000000011111bmov day, dl (18) ; 00111
Month: mov dx, ax and dx, 00000001111000000b
shr dx, 5 ; 000000000000 1100 (12)
mov month, dl Year:mov dx, axshr dx, 9 ; 011110and dx, 0000000001111111bmov year, dl (30) 10010
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Related Questions
- Assembly language 64-bit code The program will prompt the user for their name and then say hello to them using their name. For example, the interactive console of Repl.it might look like: > bash main.shEnter your name: *Camila *Hello, Camila> You will not have a library of routines to call upon for the printing and reading. You are manufacturing the complete setup and syscall. After you complete the reading, remember that .bss is for your variables that will receive data and .data is for fixed information, like prompts.arrow_forwardOS 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_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_forward
- Safari File Edit View History Bookmarks Window Help = zyBooks My library > CS 11: Introduction to Computer Science- C++ home > 1.19: LAB: Input and formatted output: Right-facing arrow 1.19 LAB: Input and formatted output: Right-facing arrow Given two input integers for an arrow body and arrowhead (respectively), print a right-facing arrow. Ex: If the input is: 01 the output is: 1 11 00000111 000001111 00000111 11 1 497630.3807866.qx3zqy7 LAB ACTIVITY learn.zybooks.com 1.19.1: LAB: Input and formatted output: Right-facing arrow 1 #include 2 using namespace std; 3 4 int main() { 5 6 7 8 9 10 11 } int baseDigit; int headDigit; /* Type your code here. *, return 0; EzyBooks catalog main.cpp :i 0/10 (( Load default template... Ơ 80 Fri Oct 13 3:27 AM Help/FAQ kimberly sandovalarrow_forwardTrue or False 1/ An arithmetic mean is an appropriate measure if the sum of all the measurements is a meaningful and interesting value. 2/ One of the benchmark principle is that it is a program written in a low-level language. 3/ Amdahl's law deals with the potential speedup of a program using multiple processors compared to a single processor.arrow_forwarda ng.cengage.com Mind Tap Ce 1 Fall CS111.ONL02.Computer Science... CENGAGE MINDTAP egramming Exercise 1.6 Instructions circle.py 1 radius float (input('5:') 2 area 3.14 * (5 *5) Write and test a program that 3 computes the area of a circle. 1. Request a number representing a radius as input from the user. 2. Use the formula 3.14 x radius? to compute the area. 3. Output this result with a suitable label. An example of the program input and output is shown below: Enter the radius: 5 The area is 78.5 square u nits. The input value should not be limited to whole numbers SEP 14arrow_forward
- San Pedro Belize Express has become the leading mode of transportation to Caye Caulker and San Pedro and neighboring islands. The changes in travel restrictions and tracking due to the Covid 19 has placed a demand on the company to keep better records of their passengers. The Company is wanting a secure ticketing system capable of keeping important and relevant information from their customers Create a python program that allows only authorized user to log into the system for ticketing transactions and customer information queries The program will accept names, phone number and SSID from User, Destination before printing tickets granting them access to board the boat The program should be able to print all customer and destination and price paid for tickets(eacher customer records should be printed on different line in a list format/ table format) Destination, San Pedro, Name, ID# Fee John Doe 2133 25 Billy Jean Ricky Martin Caye Chapel 1322 Caye Caulker 3345 30 18.50 The program will…arrow_forwardProgress (60%) Item 6/10 Time Left: 14:28 It's a text file that contains sequences of zeroes and ones What is the best definition of a script? It's an error message generated by the interpreter It's an error message generated by the compiler It's a text file that contains instructions which make up a Python program + Prev Next >arrow_forwardUniversity of Basra Asiacell I. COMPUTER_BASRA Posts computer_basra neering Since 1997 What is this flow chart stand for? (2) uha Start Computers are electronie devices that Read diytal C-A-B Prist C (2) Prien B/ hist A The computer system consists of: End (2) u What is the result of (x) after executing this program? (2) winclude jostream using namespace std; int main O Wi feeC ক int xa.b.c; a-6; b-7: Sat R ia -2 20034 e- 13; o dd t couts"x: "ox: returm 0. dale! 31 likes . اسئلة امتحان المد ل لمرحلة الأولی computer_basra سهلة ام صعبة ؟ #مهندس جامعة_الكرمه جامعات_البصرة #هندسةarrow_forward
- SWE 431: Security General Guidelines A project group can consist of at most 5 individuals. Option 1 Implement the RSA in your preferred programming language For Java,the packages java.math.BigInteger and java.security.SecureRandom should be used. For other languages, you are responsible to use similar packages. Source code must be well documented (comments). The prime numbers p and q should be at least 1024-bit. The difference of two primes should be bigger than 2512 (for security). A demonstration of encrypting a message (big mumber) and decrypting the ciphertext (big number) should be given. Your program should also include the encryption and decryption timing. The public key component e must be set to be 65537. Submit your program and a readme.txt (instructions on how to compile and run your program) to the elearning dropbox.arrow_forward| ZV1O = السؤال The memory that directly communicate with CPU is called auxiliary mamory. true false حفظ الاجابةarrow_forwardPython code, the code that I have is wrong. I am getting a error "'relative_error' is inaccurate"arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT