Answer: True
Explanation:
We start at 0 for lists
[item, item, item, item, item]
0 1 2 3 4
true on edge2020/2021
what is hyperlink and its used in website
Explanation:
Hyperlink is the primary method used to navigate between webpages.
Hyperlink can redirect us to another webpages, such as websites that has graphics, files, sounds on the same webpage.
In this assignment, you will implement an online banking system. Users can sign-up with the system, log in to the system, change their password, and delete their account. They can also update their bank account balance and transfer money to another user’s bank account.
You’ll implement functions related to File I/O and dictionaries. The first two functions require you to import files and create dictionaries. User information will be imported from the "users.txt" file and account information will be imported from the "bank.txt" file. Take a look at the content in the different files. The remaining functions require you to use or modify the two dictionaries created from the files.
Each function has been defined for you, but without the code. See the docstring in each function for instructions on what the function is supposed to do and how to write the code. It should be clear enough. In some cases, we have provided hints to help you get started.
def import_and_create_dictionary(filename):
'''
This function is used to create a bank dictionary. The given argument is the filename to load.
Every line in the file will look like
key: value
Key is a user's name and value is an amount to update the user's bank account with. The value should be a
number, however, it is possible that there is no value or that the value is an invalid number.
What you will do:
- Try to make a dictionary from the contents of the file.
- If the key doesn't exist, create a new key:value pair.
- If the key does exist, increment its value with the amount.
- You should also handle cases when the value is invalid. If so, ignore that line and don't update the dictionary.
- Finally, return the dictionary.
Note: All of the users in the bank file are in the user account file.
'''
d = {}
# your code here
return d
##########################
### TEST YOUR SOLUTION ###
##########################
bank = import_and_create_dictionary("bank.txt")
tools.assert_false(len(bank) == 0)
tools.assert_almost_equal(115.5, bank.get("Brandon"))
tools.assert_almost_equal(128.87, bank.get("James"))
tools.assert_is_none(bank.get("Joel"))
tools.assert_is_none(bank.get("Luke"))
tools.assert_almost_equal(bank.get("Sarah"), 827.43)
#user.txt
Brandon - brandon123ABC
Jack
Jack - jac123
Jack - jack123POU
Patrick - patrick5678
Brandon - brandon123ABCD
James - 100jamesABD
Sarah - sd896ssfJJH
Jennie - sadsaca
#bank.txt
Brandon: 5
Patrick: 18.9
Brandon: xyz
Jack:
Sarah: 825
Jack : 45
Brandon: 10
James: 3.25
James: 125.62
Sarah: 2.43
Brandon: 100.5
Answer:
# global variable for logged in users
loggedin = []
# create the user account list as a dictionary called "bank".
def import_and_create_dictionary(filename):
bank = {}
i = 1
with open(filename, "r") as file:
for line in file:
(name, amt) = line.rstrip('\n').split(":")
bank[i] = [name.strip(), amt]
i += 1
return bank
#create the list of user login details.
def import_and_create_accounts(filename):
acc = []
with open(filename, "r") as file:
for line in file:
(login, password) = line.rstrip('\n').split("-")
acc.append([login.strip(), password.strip()])
return acc
# function to login users that are yet to login.
def signin(accounts, login, password):
flag="true"
for lst in accounts:
if(lst[0]==login and lst[1] == password):
for log in loggedin:
if(log ==login):
print("You are already logged in")
flag="false"
break
else:
flag="false"
if(flag=="true"):
loggedin.append(login) # adding user to loggedin list
print("logged in succesfully")
return True
return False
# calling both the function to create bank dictionary and user_account list
bank = import_and_create_dictionary("bank.txt")
print (bank)
user_account = import_and_create_accounts("user.txt")
print(user_account)
# check for users loggedin
signin(user_account,"Brandon","123abcAB")
signin(user_account,"James","100jamesABD")
signin(user_account,"Sarah","sd896ssfJJH")
Explanation:
The python program is a banking application system that creates a list of user accounts and their login details from the bank.txt and user.txt file. The program also uses the information to log in and check for users already logged into their account with the "loggedin" global variable.
In this exercise we have to use the knowledge of programming in the python language, in this way we find that the code can be written as:
The code can be seen in the attached image.
To make it even simpler to visualize the code, we can rewrite it below as:
def import_and_create_dictionary(filename):
bank = {}
i = 1
with open(filename, "r") as file:
for line in file:
(name, amt) = line.rstrip('\n').split(":")
bank[i] = [name.strip(), amt]
i += 1
return bank
#create the list of user login details.
def import_and_create_accounts(filename):
acc = []
with open(filename, "r") as file:
for line in file:
(login, password) = line.rstrip('\n').split("-")
acc.append([login.strip(), password.strip()])
return acc
def signin(accounts, login, password):
flag="true"
for lst in accounts:
if(lst[0]==login and lst[1] == password):
for log in loggedin:
if(log ==login):
print("You are already logged in")
flag="false"
break
else:
flag="false"
if(flag=="true"):
loggedin.append(login) # adding user to loggedin list
print("logged in succesfully")
return True
return False
bank = import_and_create_dictionary("bank.txt")
print (bank)
user_account = import_and_create_accounts("user.txt")
print(user_account)
signin(user_account,"Brandon","123abcAB")
signin(user_account,"James","100jamesABD")
signin(user_account,"Sarah","sd896ssfJJH")
See more about programming at brainly.com/question/11288081
Pls awnser if awnser is wrong I will unmark brainliest
Answer: i think 1, 3, and 4
Explanation:
Question 4 (5 points)
The more RAM you have, the less things your computer can do at the same time.
True
False
ent:
You want to make access to files easier for your users. Currently, files are stored on several NTFS volumes such as the C:, D:, and E: drives. You want users to be able to access all files by specifying only the C: drive so they don't have to remember which drive letter to use. For example, if the accounting files are stored on the D: drive, users should be able to access them using C:\accounting. What can you do?
Answer:
volume mount points
Explanation:
The best thing to do would be to use volume mount points. This is a feature that allows you to mount/target (from a single partition) another folder or storage disk that is connected to the system. This will easily allow the user in this scenario to access the different files located in the D: and E: drive from the C:\ drive itself. Without having to go and find each file in their own separate physical drive on the computer.
Suppose that an intermixed sequence of push and pop operations are performed on a LIFO stack. The pushes push the numbers 0 through 9 in order; the pops print out the return value. For example"push(0); pop(); push(1)" and "push(0); push(1); pop()" are possible, but "push(1); push(0); pop()" is not possible, because 1 and 0 are out of order. Which of the following output sequence(s) could occur? Select all that are possible.
a) 12543 609 8 7 0
b) 01564 37928
c) 6543210789
d) 02416 75983
e) 46 8 75 32 901
Answer:
b) 01564 37928
e) 26 8 75 32 901
Explanation:
Pushes and pulls are the computer operations which enable the user to perform numerical tasks. The input commands are interpreted by the computer software and these tasks are converted into numeric values to generate output.
Why is sequencing important?
A. It allows the programmer to test the code.
B. It allows the user to understand the code.
C. It ensures the program works correctly.
D. It makes sure the code is easy to understand.
Answer:
c i think but if not go with d
Answer:
C
Explanation:
It ensures the program works correctly
hope it helps!
Four reasons why computers are powerful
Answer:
Computers are powerful tools because they can process information with incredible speed, accuracy and dependability. They can efficiently perform input, process, output and storage operations, and they can store massive amounts of data. ... Midrange servers are bigger and more powerful than workstation computers.
Suppose the following sequence of bits arrives over a link:
11010111110101001111111011001111110
Show the resulting frame after any stuffed bits have been removed. Indicate any errors that might have been introduced into the frame.
Answer:
ok
Explanation:
Complete the sentence.
If you wanted the best performance for a game that requires a powerful graphics processor and lots of memory, you
would run it on a
tablet
desktop
smartphone
The third assignment involves writing a Python program to compute the cost of carpeting a room. Your program should prompt the user for the width and length in feet of the room and the quality of carpet to be used. A choice between three grades of carpeting should be given. You should decide on the price per square foot of the three grades on carpet. Your program must include a function that accepts the length, width, and carpet quality as parameters and returns the cost of carpeting that room. After calling that function, your program should then output the carpeting cost.
Your program should include the pseudocode used for your design in the comments. Document the values you chose for the prices per square foot of the three grades of carpet in your comments as well.
You are to submit your Python program as a text file (.txt) file. In addition, you are also to submit a test plan in a Word document or a .pdf file. 15% of your grade will be based on whether the comments in your program include the pseudocode and define the values of your constants, 70% on whether your program executes correctly on all test cases and 15% on the completeness of your test report.
Answer:
# price of the carpet per square foot for each quality.
carpet_prices=[1,2,4]
def cal_cost(width,height,choice):
return width*height*carpet_prices[choice-1]
width=int(input("Enter Width : "))
height=int(input("Enter Height : "))
print("---Select Carpet Quality---")
print("1. Standard Quality")
print("2. Primium Quality")
print("3. Premium Plus Quality")
choice=int(input("Enter your choice : "))
print(f"Carpeting cost = {cal_cost(width,height,choice)}")
Explanation:
The cal_cost function is used to return the cost of carpeting. The function accepts three arguments, width, height, and the choice of carpet quality.
The program gets the values of the width, height and choice, calls the cal_cost function, and prints out the string format of the total carpeting cost.
What is the total March Expenditure now? (cell Q2)
Select the correct answer.
Jane's team is using the V-shaped model for their project. During the high-level design phase of the project, testers perform integration testing
What is the purpose of an integration test plan in the V-model of development?
OA. checks if the team has gathered all the requirements
OB. checks how the product interacts with external systems
ОC. checks the flow of data in internal modules
OD. checks how the product works from the client side
Answer:
a
Explanation:
As you will solve more complex problems, you will find that searching for values in arrays becomes a crucial operation. In this part of the lab, you will input an array from the user, along with a value to search for. Your job is to write a C++ program that will look for the value, using the linear (sequential) search algorithm. In addition, you should show how many steps it took to find (or not find) the value, and indicate whether this was a best or worst case scenario (... remember the lecture). You may refer to the pseudo-code in the lecture, but remember that the details of the output and error conditions are not specified there. Also, note that in pseudo-code arrays are sometimes defined with indices 1 to N, whereas in C++ the indexes span from 0 to N-1.
The program will work as follows. First, you should ask the user to enter the size of the array, by outputting:
"Enter the size of the array: "
to the console. If the user enters an incorrect size, you should output the error message:
"ERROR: you entered an incorrect value for the array size!"
and exit the program. If the input is a valid size for the array, ask the user to enter the data, by outputting
"Enter the numbers in the array, separated by a space, and press enter: "
Let the user enter the numbers of the array and store them into a C++ array. Up to now, this should be exactly the same code as Lab#2. Next, ask the user a value v to search for in the array (called the "key"), by outputting:
"Enter a number to search for in the array: " to the screen, and read the key v.
Search for v by using the linear search algorithm. If your program finds the key, you should output:
"Found value v at index i, which took x checks. "
where i is the index of the array where v is found, and x is the number of search operations taken place.
If you doesn't find the key, then output: "
The value v was not found in the array!"
Then indicate whether you happened to run into a best or worst case scenario. In case you did, output: "
We ran into the best case scenario!" or "We ran into the worst case scenario!"
otherwise, don't output anything.
Answer:
#include<iostream>
using namespace std;
int main() {
cout<<"Enter The Size Of Array: ";
int size;
bool isBestCase=false;
cin>>size;
if(size<=0){
cout<<"Error: You entered an incorrect value of the array size!"<<endl;
return(0);
}
int array[size], key;
cout<<"Enter the numbers in the array, separated by a space, and press enter:";
// Taking Input In Array
for(int j=0;j<size;j++){
cin>>array[j];
}
//Your Entered Array Is
for(int a=0;a<size;a++){
cout<<"array[ "<<a<<" ] = ";
cout<<array[a]<<endl;
}
cout<<"Enter a number to search for in the array:";
cin>>key;
for(i=0;i<size;i++){
if(key==array[i]){
if(i==0){
isBestCase=true; // best case scenario when key found in 1st iteration
break;
}
}
}
if(i != size){
cout<<"Found value "<<key<<" at index "<<i<<", which took " <<++i<<" checks."<<endl;
} else{
cout<<"The value "<<key<<" was not found in array!"<<endl;
cout<<"We ran into the worst-case scenario!"; // worst-case scenario when key not found
}
if(isBestCase){
cout<<"We ran into the best case scenario!";
}
return 0;
}
Explanation:
The C++ source dynamically generates an array by prompting the user for the size of the array and fills the array with inputs from the user. A search term is used to determine the best and worst-case scenario of the created array and the index and search time is displayed.
For which of the following tasks would a for-each loop be appropriate?
A. Reversing the order of the elements in an array.
B. Printing all the elements at even indices of an array.
C. Printing every element in an array.
D. Determining how many elements in an array of doubles are positive.
E. Determining whether an array of Strings is arranged in alphabetical order.
F. Printing every even number in an array of ints.
Answer:
The answer is "Option B, C, and F".
Explanation:
In the For-each loop, it is used for traversing items in a sequence is the control flow expression. It typically required a loop becomes referred to it as an enhanced loop for iterating its array as well as the collection elements. This loop is a version shortcut that skips the need for the hasNext() method to get iterator and the loop and over an iterator, and the incorrect choice can be determined as follows:
In choice A, it is wrong because it can't reverse the array element.In choice D, it is wrong because it can't determine the array of positive.In choice E, it is wrong because it can't determine an array of the sting in alphabetical order.write an algorithm and draw a flowchart to calculate the sum of of the first 10 natural numbers starting from 1
Answer:
#include <stdio.h>
void main()
{
int j, sum = 0;
printf("The first 10 natural number is :\n");
for (j = 1; j <= 10; j++)
{
sum = sum + j;
printf("%d ",j);
}
printf("\nThe Sum is : %d\n", sum);
}
Within a loop
Step 1: Initialize a variable to 1 (say x=1)
Step 2: Specifiy the condition
In this case x<=10
Step 3: Increment the variable by 1
using increment operator x++
OR
simply x+=1(x=x+1)
Step 4: Print the value of variable
Terminate the loop
Explanation:
Define the meaning of software quality and detail the factors which affects the quality not productivity of a software product?
Answer:
Quality of software may be defined as the need of function and Efficiency. ... A number of factors are given below which gives the effects on quality and production capacity.
Software quality is known to be the method that tells the desirable characteristics of software products.
What are the Software Quality Factors that affects it?The factors that influence software are;
CorrectnessReliabilityEfficiencyUsability, etc.Therefore, Software quality is known to be the method that tells the desirable characteristics of software products.
Learn more about software quality from
https://brainly.com/question/13262395
#SPJ2
#include
main()
{
int i, n=10, rem, inc=0;
scanf("%d",&n);
for(i=1; i =3)
inc++;
else;
inc--;
}
printf("Final Value=\n",inc);
}
SOLVE THIS PROGRAM...
Answer:inpossible !889
Explanation: I npossible !889
True or False
3.The title tag defines a title for the page on the browser's Title bar.
Answer:
it would be false because of the word tag you can title a browser bar tag
Explanation:
cause it would be improper
Is a NAS just a collection of hard drives or a computer
Answer:
NAS systems are networked appliances that contain one or more storage drives, often arranged into logical, redundant storage containers or RAID.
Draw a flowchart diagram for a program that display a person's name x times
Answer:
See attachment for flowchart
Explanation:
The flowchart is as follows:
Step 1: Start
This signals the beginning of the flowchart
Step 2: Input name, x
This gets input for name and x from the user
Step 3: count = 0
This initializes count to 0
Step 4: Print name
This prints the person's name
Step 5: count = count + 1
This increments the number of times the name has been printed
Step 6: count = x?
This checks if the number of times the name has been printed is x times
If yes, step 7 is executed.
If no, step 4 is executed
Step 7: Stop
This signals the end of the flowchart