SampleExample2023-2
.pdf
keyboard_arrow_up
School
University of Michigan *
*We aren’t endorsed by this school
Course
106
Subject
Computer Science
Date
Apr 3, 2024
Type
Pages
8
Uploaded by BailiffStrawMeerkat43 on coursehero.com
SI106 Exam Fall 2023
Name: ___________________________
Unique name: __________________________
THIS IS A LONG TEST.
There are 27 questions and each question is worth 4pts
unless noted otherwise in the question. There are a total of 110 points. 90 points is
100%. The max score is 100 points, so you can get some extra credit.
Answer the questions as carefully and (when applicable) as concisely as you can.
There will be deductions for missing key components in your answer. There will also
be deductions if you include information that is not true.
●
WRITE NEATLY IN THE ANSWER BOXES PROVIDED.
●
READ THE QUESTIONS CAREFULLY.
If you are unsure about a question, you can write your assumptions to the side but we
will not be taking questions during the quiz.
1.
What is the return type of .split()?
2. What is the return type of .join()?
3.
What is the return type of .isupper()?
4. What is the return type of .append()?
5. What is the return type of .items()?
6. What is the return type of .read()?
7. What is the return type of .readlines()?
I am going to list common error types here to help you with Q8-12
SyntaxError, NameError, AttributeError, TypeError, KeyError,
AssertionError, IndexError, ZeroDivisionError
8. What type of error is returned in the following code?
my_list = [1,2,3,4,5]
print(my_list[5])
9. What type of error is returned in the following code?
my_list = [1,2,3,4,5]
print(my_list.split("!"))
10.What type of error is returned in the following code?
my_list = [1,2,3,4,5]
assert len(my_list) == 10
11.What type of error is returned in the following code?
my_dict = {}
print(my_dict[1])
12.What type of error is returned in the following code?
num_str = "1 # 2 # -34"
for num in num_str.split('#'):
product *= int(num)
Questions 13 - 17 do not generate errors
13.What is the output of the following code snippet?
words = ['the', 'quick', 'brownish', 'fox', 'jumped']
count = 0
for word in words:
if len(word) >= 5:
count += 1
print(count)
14.What is the output of the following code snippet?
words = ['the', 'quick', 'brownish', 'fox', 'jumped']
for word in words:
count = 0
if len(word) > 4:
count += 1
print(count)
15.What is the output of the following code snippet?
my_list = ["cat","dog","fish"]
for i in range(len(my_list)):
print(i)
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
C++
Exercise A:
In this exercise, you are asking the user to set a alpha numeric password for any website. Put some conditions.
Password must be 8 characters long.
There must be at-least one uppercase letter
There must be at least one number.
Then show the user, you have set the correct password or not.
Exercise B:
This exercise is the extension of the above Exercise. In this exercise we are not checking all the criteria of having a good password.
Here ask the user to enter his/her password twice. If both matches, thanks the customer otherwise loop your code until user enters both passwords same.
arrow_forward
Create and deploy a programme that uses numbers to play the Hi-Lo guessing game. The software ought to choose a random number between 1 and 100 (inclusive) and then ask the user to estimate it again. Inform the user if their estimate was right, high, or low for each guess. Accept guesses until the user decides to stop or guesses right. To ascertain if the user wishes to exit, utilise a sentinel value. When the user successfully guesses, tally the number of guesses and report that figure. Ask the user if they want to play again when each game is finished (by leaving or a successful guess). Play video games till the user decides to quit.
arrow_forward
For 4.31 (a) Do not use the passing the baton technique. Solve the problem directly using semaphores. Your answer to Question (a) should be similar to the solution to the Reader/writer's Problem. For Exercise 4.31 (b), you must define the following shared variables/semaphores and use the technique of passing the baton:
int nN = 0; // number of northbound cars on the bridge
int nS = 0; // number of southbound cars on the bridge
sem e = 1; // controls entry to critical section
n = 0; // used to delay northbound cars
s = 0; // used to delay southbound cars
int dn = 0; // number of delayed northbound cars
ds = 0; // number of delayed southbound cars
arrow_forward
Please revise this code so that the outputs are correct.
Current it’s flagging a syntax error. See screen shot. Also view the lab ( 2nd ) screen shot.
Please use both inputs to produce both out outputs.
1st input:
Testit
test
1st output:
Unsuccessful login attempt!
Try again – you have four times left!
2nd input:
Test
Test1234
Second output:
Successful login!
Current code needs amended:
 #class Login
class Login:
#__init__
def __init__(self):
#initializing login_name as none
self.login_name = 'none'
#initializing login_password as none
self.login_password = 'none'
#check_credentials()
def check_credentials(self, user_login, user_passwd):
#initializing simlogin as 'Test'
simlogin = 'Test'
#initializing simpass as 'Test'
simpass = 'test1234'
#if user sent the correct credentials
if user_login == simlogin and user_passwd == simpass:
#print "Successful…
arrow_forward
Using C# and Windows Presentation Foundation (WPF), design and implement a standalone desktop time management application that fulfils the following requirements:
1. The user must be able to add multiple modules for the semester. The following data must be stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester.4. The software shall display a list of the modules with the number of hours of self-study that is required for each module per week.
The number shall be calculated as follows:
self-study hours per week=number of credits × 10/number of weeks − class hours per week
5. The user must be able to record the number of hours that they spend working on a specific module on a certain date.6. The software shall display how many…
arrow_forward
Using C# and Windows Presentation Foundation (WPF), design and implement a standalonedesktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data mustbe stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester
4. The software shall display a list of the modules with the number of hours of self‐study thatis required for each module per week. The number shall be calculated as follows:self-study hours per weekൌ number of credits ൈ 10number of weeks െ class hours per week5. The user must be able to record the number of hours they spend working on a specificmodule on a certain date.6. The software shall display how many hours of…
arrow_forward
Using C# and Windows Presentation Foundation (WPF), design and implement a standalonedesktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data mustbe stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester
The software shall display a list of the modules with the number of hours of self‐study thatis required for each module per week. The number shall be calculated as follows:self-study hours per week?number of credits ? 10number of weeks? class hours per week5. The user must be able to record the number of hours they spend working on a specificmodule on a certain date.6. The software shall display how many hours of self‐study…
arrow_forward
Q1: Research Groups
In response to popular demand, Dan’s established two research groups A and B composed of his n graduate students. Each of these students is a member of exactly one of the two groups at any given time. The students are numbered from 1 to n in some arbitrary order.
To measure the success of his research groups, Dan assigns a citation score to each of them. Initially, both groups have citation score 0. Throughout the semester, events of the following two types happen:
Student x publishes a paper in which they cite student y’s work (youcan assume all of the students have been around long enough to have prior research that can be cited). As a result,
If x and y are in the same group, their group’s citation score increases by 1.
If x and y are in different groups, y’s group’s citation score increases by 5.
Dan changes student x’s group (from A to B or from B to A) to have them
work on different projects.
To assess the overall success of the research groups, Dan…
arrow_forward
Exercise 4. The worksheet “Hours” (see attached Excel file) contains the number of hours that 7 employees have worked over the past 100 days. Some employees have not worked in some days.
a) Create a function named employee that takes an employee name as parameter and returns the range of cells starting day 1 until the last consecutive day that the employee has worked from day 1. For instance, this range for Alex should be “B2:B27”.
b) Create a sub that takes an employee name as input from the user, checks to ensure the name is valid (returns error message if the name is not one of the 7 names) and if the name is valid then calls on function employee to get the range of consecutive days that the employee has worked starting day 1 and then computes the sum of the number of hours the employee has worked over consecutive days since day. This sum should then be written in a new row under the same data with row name “Cons Days”
c) Create a sub that builds a table somewhere on the right side…
arrow_forward
Using C# and Windows Presentation Foundation (WPF)1, design and implement a standalone desktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data must be stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester.4. The software shall display a list of the modules with the number of hours of self-study that is required for each module per week.
The number shall be calculated as follows:self-study hours per week=number of credits × 10number of weeks − class hours per week5. The user must be able to record the number of hours that they spend working on a specific module on a certain date.6. The software shall display how many hours…
arrow_forward
Using C# and Windows Presentation Foundation (WPF)1, design and implement a standalone desktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data must be stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester.4. The software shall display a list of the modules with the number of hours of self-study that is required for each module per week. The number shall be calculated as follows:self-study hours per week=number of credits × 10number of weeks − class hours per week5. The user must be able to record the number of hours that they spend working on a specific module on a certain date.6. The software shall display how many hours…
arrow_forward
C++
3.23 LAB: Interstate highway numbers
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is:
90
the output is:
I-90 is primary, going east/west.
Ex: If the input is:
290
the output is:
I-290 is auxiliary, serving I-90, going east/west.
Ex: If the input is:
0
the output is:
0 is not a valid interstate highway number.
arrow_forward
WHATS THE ALGORITHIM FOR THIS
The course records are shown below: Each student has 4 assignments.
108194 9 10 10 10
197526 10 10 10 10
197008 10 10 0 10
197746 10 10 9 10
108154 10 0 10 9
Create an input file ‘CSassignments.txt’ using an editor such as Notepad++ with a student number, then a space, then four assignment marks on one line. The assignment marks are whole numbers and are separated by a space.
Your C++ program will read from the file ‘CSassignments.txt’ and write to a second file ‘CSgrades.txt’ which includes the average of the student’s four assignments.
e.g. 108194 9 10 10 10 9.75
Your C++ program should work with any number of records in the ‘CSassignments.txt’ input file – that is –…
arrow_forward
“Performance” or “response time.” defines how fast an application presents an output once given an input. Assume you are building an app, and one of the engineers on the team thinks the Sieve of Eratosthenes algorithm will be the bottleneck in satisfying performance requirements. They have executed the algorithm and set it under test to create a performance baseline.
(Please, find below A4.py and primeSieve.py)
Run A4.py and report the result from the part 1 section: “X function calls in Y seconds.” After the remainder of the application and main algorithms are written, the engineers set the full application under performance testing, in part 2 of A4.py.
Record the result from the part 2 section: “X function calls in Y seconds.”
The method described in this section is to examine performance by making an educated guess on where performance bottlenecks occur
before finishing and testing the entire application (or at least a complete portion of a significant function)
Was it a good…
arrow_forward
4.16 LAB: Interstate highway numbers
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is:
90
the output is:
I-90 is primary, going east/west.
Ex: If the input is:
290
the output is:
I-290 is auxiliary, serving I-90, going east/west.
Ex: If the input is:
0
the output is:
0 is not a valid interstate highway number.
Ex: If the input is:
200
the output is:
200 is not a valid interstate highway number.
See Wikipedia for more info on highway numbering.
344614.2153518.qx3zqy7
Use Python. Don't use Java cause that's…
arrow_forward
Assume you are working for a company and given the task to build an Email Registration Program. Theemail registration program functions as follows.• Prompt the user four things: first name, last name, security question answer, and birthyear.o Example:Enter first name: LeBronEnter last name: James(Security Question) Favorite car maker: BentleyEnter birth year: 1984• Generate a default Kean email address based on the first name and last name.o The default Kean email address consists of the first letter of the first name, a period, theentire last name all in lower case appended with @kean.edu.o Example: LeBron James → l.james@kean.edu• Generate a default password based on the last name, security question answer, and birthyear.o The default password is a sequence of 3 letters from last name, birthyear, and 3 lettersfrom the security question answer all in upper case.o Example: LeBron, 1984, Bentley → LEB1984BEN• Display the email information with first name, last name, email address, and…
arrow_forward
Assume you are working for a company and given the task to build an Email Registration Program. Theemail registration program functions as follows.• Prompt the user four things: first name, last name, security question answer, and birthyear.o Example:Enter first name: LeBronEnter last name: James(Security Question) Favorite car maker: BentleyEnter birth year: 1984• Generate a default Kean email address based on the first name and last name.o The default Kean email address consists of the first letter of the first name, a period, theentire last name all in lower case appended with @kean.edu.o Example: LeBron James → l.james@kean.edu• Generate a default password based on the first name, security question answer, and birthyear.o The default password is a sequence of 3 letters from last name, birthyear, and 3 lettersfrom the security question answer all in upper case.o Example: LeBron, 1984, Bentley → LEB1984BEN• Display the email information with first name, last name, email address, and…
arrow_forward
Solve this problem, include c++ code and flowchart please.
Problem Bad Spelling (Recurse)
Problem Overview:
Annagramma Hawkin is a witch… but not a very good one. According to some very senior witches she is overly concerned with flashy magics and not nearly concerned enough about real problems facing real people. Her latest equipment acquisition underlines this flair for the dramatic. She bought an enchanted Boggle set. This device functions by generating a 5x5 grid of letters. Any sequence of letters connected to each other either by being beside or diagonal from each other (with each letter used only once) creates a successful and entirely satisfyingly flashy spell. It really just saves witches from having to generate their own spell names and allows them to avoid the use of ones like: Hocus Pocus.
For example, consider a 5x5 grid with random letters as depicted below. The object is to find words formed in the grid by contiguous sequences of letters. Letters are considered to be…
arrow_forward
profile-image
Time remaining:
00
:
09
:
42
Computer Science
C++. Need help writing a program that plays the game of Hangman. The program should pick a word (which is either coded directly into the program or read from a text file) and display the following:
Guess the word: XXXXXX
Each X represents a letter. The user tries to guess the letters in the word. The appropriate response yes or no should be displayed after each guess. After each incorrect guess, display the diagram with another body part filled. After seven incorrect guesses, the user should be hanged. The display should look as follows:
O
/|\
|
/ \
After each guess, display all user guesses. If the user guesses the word correctly, display: " Congratulations!!! You guessed my word. Play again? yes/no "
Please help in making this code and if possible to include steps to learn what most of the lines and functions do in order to understand it better. Thank you.
arrow_forward
A c++ code for a shopping mall,
The parking garage contains a single lane that holds up to 50vehicles. However, first 10 locations are dedicated to some customers. For the remaining parking places, there is only a single entrance/exit to the garage.
If a customer arrives to pick up a vehicle and it is not nearest the exit, all vehicles blocking its path are moved out. The customer’s vehicle is driven out and the other vehicles are restored in the sameorder as they were in original.
arrow_forward
def main(): monthlySales = getSales() printbonus=print_bonus(storeAmount,empAmount)
#This function gets the monthly salesdef getSales(): monthlySales = float(input('Enter the monthly sales $')) monthlySales = getSales() #call to get sales salesIncrease = getIncrease(monthlySales) return monthlySales #This function gets the percent of increase in salesdef getIncrease(monthlySales): storeAmount = storeBonus(monthlySales) salesIncrease = float(input('Enter percent of sales increase: ')) salesIncrease = float(salesIncrease) salesIncrease = salesIncrease / 100 return salesIncrease
#This function determines the storeAmount bonusdef storeBonus(monthlySales): if monthlySales >= 110000: storeAmount = 6000 elif monthlySales >= 100000: storeAmount = 5000 elif monthlySales >= 90000: storeAmount = 4000 elif monthlySales >=80000: storeAmount = 3000 else: storeAmount = 0 return storeAmount
#This function…
arrow_forward
First class was posted in this question, third class will be posted in a different question, please refer to it, thank you: https://www.bartleby.com/questions-and-answers/computer-science-question/34b2a175-1365-4989-a811-33c7e8b66a7b
Do not change the function names or given starter code in the script. Each class has different requirements, read them carefully. Do not use the exec or eval functions, nor are you allowed to use regular expressions (re module). All methods that output a string must return the string, not print it. If you are unable to complete a method, use the pass statement to avoid syntax errors.
Section 2: The Calculator class Implement a class that calculates mathematic expressions. The input passed to this Calculator is in infix notation, which gets converted to postfix internally, then the postfix expression is evaluated (we evaluate in postfix instead of infix because of how much simpler it is). More details about infix to postfix conversion can be found…
arrow_forward
Using C# and Windows Presentation Foundation (WPF)1, design and implement a standalone desktop time management application that fulfils the following requirements: 1. The user must be able to add multiple modules for the semester. The following data must be stored for each module:
a. Code, for example, PROG6212
b. Name, for example, Programming 2B
c. Number of credits, for example, 15
d. Class hours per week, for example, 5 2. The user must be able to enter the number of weeks in the semester. 3. The user must be able to enter a start date for the first week of the semester. 4. The software shall display a list of the modules with the number of hours of self-study that is required for each module per week. The number shall be calculated as follows: self-study hours per week= number of credits × 10 / number of weeks − class hours per week 5. The user must be able to record the number of hours that they spend working on a specific module on a certain date. 6. The software shall…
arrow_forward
Create a script file voting_age that, given the name and age of citizen A, returns a message indicating if citizen A is eligible or not eligible to vote this coming election 2010.
a. Test the script file voting_age for the following cases:i. Juan dela Cruz, age 33ii. Zion Alexander, age 18
arrow_forward
please create a python script for the practice excersie with an explanation. I provided my starter code and my desired outcome in the images.
In that file implement the functions listed below by following the guidelines given. Assume the user enters the full name as "First Last". (No need to validate input)
generate_EmailID: This function takes the user’s full name in the form “First Last” and creates and returns the email id by using these rules:The email id is all lower case.email id is of the form “last.first@fhs.edu”. e.g. For "John Doe" it will be "doe.john@fhs.edu".See sample runs above.generate_Password: This function takes the user's full name and generates and returns a temporary password by using these rules. The temporary passwordstarts with the first 2 letters of the first name, made lower case.followed by a number which is the product of the lengths of the first and last namefollowed by a single random letter from these special characters: '!', '@', '#', '$', '%',…
arrow_forward
Build Brothers company in C
A civil engineering company called Build Brothers has approached you to write a program to help some of their employees with getting their job quicker specially when it comes to calculating different equations in their construction projects. Currently, they use the following PDF to perform all their calculations:
http://www.madison-lake.k12.oh.us/userfiles/680/Classes/16192/IED-Review%20Engineering%20Formula%20Sheet.pdf
They are willing to develop a small software to calculate all the functions and calculations in the above cheat sheet. They have made this decision to reduce inherent human errors during calculation and improve efficiency. They think that these can be achieved by an “advanced calculator” that allows a user to choose an equation, provide the inputs, and calculate the outputs. Before the company invests on the final product, the have agreed on developing a proof-of-concept first. The idea is that your solution will ‘prove’ that a better…
arrow_forward
Create and build a software that plays the Hi-Lo guessing game with numbers. The software should pick a number at random between 1 and 100 (inclusive) and then ask the user to estimate it again. For each guess, inform the user if their estimate was right, high, or low. Accept guesses until the user decides to quit or makes the correct guess. Use a sentinel value to determine whether the user wishes to exit. When the user correctly guesses, count the number of guesses and give the total. When each game is completed (by leaving or a correct guess), ask the user whether they want to play again. Play video games till the user decides to discontinue.
arrow_forward
GDB and Getopt Class Activity
activity [-r] -b bval value
Required
Modify the activity program from last week with the usage shown. The value for bval is required to be an integer as is the value at the end. In addition, there should only be one value.
Since everything on the command line is read in as a string, these now need to be converted to numbers.
You can use the function atoi() to do that conversion.
You can do the conversion in the switch or you can do it at the end of the program.
The number coming in as bval and the value should be added together to get a total.
That should be the only value printed out at the end. Total = x should be the only output from the program upon success. Remove all the other print statements after testing is complete.
Take a screenshot of the output to paste into a Word document and submit.
Practice
Compile the program with the -g option to load the symbol table.
Run the program using gdb and use watch on the result so the program stops when the…
arrow_forward
Function written in JavaScript Please thanks!
Function 1: Password Checkerfunction _one(pwd)Create a JavaScript function that meets the following requirements:• Is passed a string representing a potential password• The function determines if the password meets the following requirementso The length of the password is between 8 – 12 characterso Contains at least 1 number (numeric character)o Contains at least 1 special character▪ Special characters are punctuation characters that are present on standard keyboard namely any character encapsulated within the following double quotes“(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)”o Contains at least 1 capital letter• The function should NOT employ the use of regular expressions to solve the problem• The function also displays the result (console log) of its password validation as illustrated below.• The function returns a Boolean back to the caller indicating valid or not.
arrow_forward
Building off the game you wrote a couple of weeks ago, called "21," you are going to add file writing and file reading.
For each game played you will write the final results for the player and the computer.
The data written should something look like this:
19 21
18 23
21 16
You will have the player data first, a tab '\t', and then the computer result followed by a newline '\n'
So, in the example above, in the first game, the player got 19 and the computer got 21.
In the second game, the player got 18 and the computer got 23.
After the player stops the program, you will close the writing file stream and open the input file stream of the newly created file.
Read each line of numbers and calculate:
The average result of the player for all the games played.
The average result of the computer for all the games played.
The total wins for the player and the computer.
Then, declare who is the best 21 player!
The output from above will…
arrow_forward
A safe has 5 locks v,w,x,y,z all of which must be unlocked for the safe to open
The keys to the locks are distributed among five executives in the following manner:
i. A has keys for locks v and x;
ii.B has keys for locks v and y;
iii.c has keys for locks w and y;
iv.D has keys for locks x and z;
v.Ehas keys for locks v and Z.
vi.Find all the combinations of executives that can open the safe. Write an expression
vii.f(A,B,C,D,E)which specifies when the safe can be opened as a function of which
viii. Executives are present.
arrow_forward
Question 5
URGENT!!
1. The file walk.txt contains a list of walk distances completed over the course of a year. Write a Python script to read walk.txt and display the average hike distance
Full explain this question and text typing work only
We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Related Questions
- C++ Exercise A: In this exercise, you are asking the user to set a alpha numeric password for any website. Put some conditions. Password must be 8 characters long. There must be at-least one uppercase letter There must be at least one number. Then show the user, you have set the correct password or not. Exercise B: This exercise is the extension of the above Exercise. In this exercise we are not checking all the criteria of having a good password. Here ask the user to enter his/her password twice. If both matches, thanks the customer otherwise loop your code until user enters both passwords same.arrow_forwardCreate and deploy a programme that uses numbers to play the Hi-Lo guessing game. The software ought to choose a random number between 1 and 100 (inclusive) and then ask the user to estimate it again. Inform the user if their estimate was right, high, or low for each guess. Accept guesses until the user decides to stop or guesses right. To ascertain if the user wishes to exit, utilise a sentinel value. When the user successfully guesses, tally the number of guesses and report that figure. Ask the user if they want to play again when each game is finished (by leaving or a successful guess). Play video games till the user decides to quit.arrow_forwardFor 4.31 (a) Do not use the passing the baton technique. Solve the problem directly using semaphores. Your answer to Question (a) should be similar to the solution to the Reader/writer's Problem. For Exercise 4.31 (b), you must define the following shared variables/semaphores and use the technique of passing the baton: int nN = 0; // number of northbound cars on the bridge int nS = 0; // number of southbound cars on the bridge sem e = 1; // controls entry to critical section n = 0; // used to delay northbound cars s = 0; // used to delay southbound cars int dn = 0; // number of delayed northbound cars ds = 0; // number of delayed southbound carsarrow_forward
- Please revise this code so that the outputs are correct. Current it’s flagging a syntax error. See screen shot. Also view the lab ( 2nd ) screen shot. Please use both inputs to produce both out outputs. 1st input: Testit test 1st output: Unsuccessful login attempt! Try again – you have four times left! 2nd input: Test Test1234 Second output: Successful login! Current code needs amended:  #class Login class Login: #__init__ def __init__(self): #initializing login_name as none self.login_name = 'none' #initializing login_password as none self.login_password = 'none' #check_credentials() def check_credentials(self, user_login, user_passwd): #initializing simlogin as 'Test' simlogin = 'Test' #initializing simpass as 'Test' simpass = 'test1234' #if user sent the correct credentials if user_login == simlogin and user_passwd == simpass: #print "Successful…arrow_forwardUsing C# and Windows Presentation Foundation (WPF), design and implement a standalone desktop time management application that fulfils the following requirements: 1. The user must be able to add multiple modules for the semester. The following data must be stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester.4. The software shall display a list of the modules with the number of hours of self-study that is required for each module per week. The number shall be calculated as follows: self-study hours per week=number of credits × 10/number of weeks − class hours per week 5. The user must be able to record the number of hours that they spend working on a specific module on a certain date.6. The software shall display how many…arrow_forwardUsing C# and Windows Presentation Foundation (WPF), design and implement a standalonedesktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data mustbe stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester 4. The software shall display a list of the modules with the number of hours of self‐study thatis required for each module per week. The number shall be calculated as follows:self-study hours per weekൌ number of credits ൈ 10number of weeks െ class hours per week5. The user must be able to record the number of hours they spend working on a specificmodule on a certain date.6. The software shall display how many hours of…arrow_forward
- Using C# and Windows Presentation Foundation (WPF), design and implement a standalonedesktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data mustbe stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester The software shall display a list of the modules with the number of hours of self‐study thatis required for each module per week. The number shall be calculated as follows:self-study hours per week?number of credits ? 10number of weeks? class hours per week5. The user must be able to record the number of hours they spend working on a specificmodule on a certain date.6. The software shall display how many hours of self‐study…arrow_forwardQ1: Research Groups In response to popular demand, Dan’s established two research groups A and B composed of his n graduate students. Each of these students is a member of exactly one of the two groups at any given time. The students are numbered from 1 to n in some arbitrary order. To measure the success of his research groups, Dan assigns a citation score to each of them. Initially, both groups have citation score 0. Throughout the semester, events of the following two types happen: Student x publishes a paper in which they cite student y’s work (youcan assume all of the students have been around long enough to have prior research that can be cited). As a result, If x and y are in the same group, their group’s citation score increases by 1. If x and y are in different groups, y’s group’s citation score increases by 5. Dan changes student x’s group (from A to B or from B to A) to have them work on different projects. To assess the overall success of the research groups, Dan…arrow_forwardExercise 4. The worksheet “Hours” (see attached Excel file) contains the number of hours that 7 employees have worked over the past 100 days. Some employees have not worked in some days. a) Create a function named employee that takes an employee name as parameter and returns the range of cells starting day 1 until the last consecutive day that the employee has worked from day 1. For instance, this range for Alex should be “B2:B27”. b) Create a sub that takes an employee name as input from the user, checks to ensure the name is valid (returns error message if the name is not one of the 7 names) and if the name is valid then calls on function employee to get the range of consecutive days that the employee has worked starting day 1 and then computes the sum of the number of hours the employee has worked over consecutive days since day. This sum should then be written in a new row under the same data with row name “Cons Days” c) Create a sub that builds a table somewhere on the right side…arrow_forward
- Using C# and Windows Presentation Foundation (WPF)1, design and implement a standalone desktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data must be stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester.4. The software shall display a list of the modules with the number of hours of self-study that is required for each module per week. The number shall be calculated as follows:self-study hours per week=number of credits × 10number of weeks − class hours per week5. The user must be able to record the number of hours that they spend working on a specific module on a certain date.6. The software shall display how many hours…arrow_forwardUsing C# and Windows Presentation Foundation (WPF)1, design and implement a standalone desktop time management application that fulfils the following requirements:1. The user must be able to add multiple modules for the semester. The following data must be stored for each module:a. Code, for example, PROG6212b. Name, for example, Programming 2Bc. Number of credits, for example, 15d. Class hours per week, for example, 52. The user must be able to enter the number of weeks in the semester.3. The user must be able to enter a start date for the first week of the semester.4. The software shall display a list of the modules with the number of hours of self-study that is required for each module per week. The number shall be calculated as follows:self-study hours per week=number of credits × 10number of weeks − class hours per week5. The user must be able to record the number of hours that they spend working on a specific module on a certain date.6. The software shall display how many hours…arrow_forwardC++ 3.23 LAB: Interstate highway numbers Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. Ex: If the input is: 90 the output is: I-90 is primary, going east/west. Ex: If the input is: 290 the output is: I-290 is auxiliary, serving I-90, going east/west. Ex: If the input is: 0 the output is: 0 is not a valid interstate highway number.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage