Answer:
// Program is written in Java Programming Language
// Comments are used for explanatory purpose
// Program starts here
import java.util.Scanner;
public class checkPass{
public static void main (String [] args)
{
// Call scanner function
Scanner input = new Scanner (System.in);
// Declare user password and number
string userpass;
int usernum;
// Initialise password and number
string password = "milkway";
int number = 1847;
// Initialise number of attempts to 0
int attempts = 0;
while (attempts<=10 )
{
// Prompt user to enter password and number
System.out.println("Enter password: ");
userpass = input.nextLine();
System.out.println("Enter Number: ");
usernum = input.nextInt();
if(userpass == password && usernum == number)
{
System.out.print("Access Granted");
attempts = 11;
}
else
{
System.out.print("Wrong Credentials");
attempts++;
}
}
}
}
Explanation:
The correct password and number are defined and stored in their respective variables. While loop is used to keep on taking input from the user until the user inputs correct password and number or user runs out of attempts. The number of attempts is set to 3 but can be changed to any number as you like.
The user is asked to input password first then we check if the user wants to quit? if true terminate program else continue to get the input number from the user.
Now we have password and number from the user, check if both are correct? if yes then grant the access else wrong credentials add one to the attempt, display the number of attempts left and repeat the whole loop again.
Python Code:
password = "milkyway"
number = 1847
attempts=0
while attempts < 3:
pas=str(input("Please Enter the Password\n"))
if pas=="quit":
print("You quit!")
break
num=int(input("Please Enter the Number\n"))
if pas==password and num==number:
print("Access Granted")
else:
print("Wrong credentials")
attempts+=1
print("Attempts left: ",3-attempts)
Output:
Test 1:
Please Enter the Password
waysnf
Please Enter the Number
1847
Wrong credentials
Attempts left: 2
Please Enter the Password
milkyway
Please Enter the Number
1942
Wrong credentials
Attempts left: 1
Please Enter the Password
milkyway
Please Enter the Number
1847
Access Granted
Test 2:
Please Enter the Password
menas
Please Enter the Number
4235
Wrong credentials
Attempts left: 2
Please Enter the Password
quit
You quit!
Note: feel free to ask in comments if you dont understand anything!
declared
B.
deallocated
C.
initialized
D.
All of the above
Answer:
A. declared
Explanation:
Before a structure can be used, it must be declared.
For example:
// Structure definition
struct s{
int a;
char b;
};
// Structure instantiation
struct s mystruct;
// This is where a structure instance called mystruct is created whose
// datatype is struct s.
mystruct.a = 10;
mystruct.b = 'c';
As we can see from the example definition precedes use for the structure.
Answer:
when you call yourself fat or ugly......but that was my answer but pls dont ever be negative abt yalls selfs i love yall the way u are and if u eva wanna talk ill do it in the comments
Explanation:
Answer:
for example, when there is a bad driver on the road near you does something dumb and the little voice in your head always says you idiot watch where you are going. It also can be when you put yourself down like saying that you are dumb or that you will never get a job
Answer:
Explanation:
Top-down design allows a programmer to take a complex idea, break it down into high-level tasks which can be further broken down into more detailed sub-tasks (Evans, Martin, & Poatsy, 2018). The larger a program gets, the more important it is to have a clear design. It is easier to fix an error during the design phase than the coding phase. If the design is flawed, a programmer can end up having to delete or rewrite large portions of code. Reworking large portions of a design is preferable to rewriting large portions of code. Even small programs can become overwhelming with a number of tasks to perform. Hierarchy Chart (hierarchical diagram) shows the breakdown of a system to its lowest manageable parts. It is a top-down modular design tool, constructed of rectangles (that represents the different modules in a system) and lines that connect them. The lines explain the connection and/or ownership between the different modules among the system just like in an organizational chart. main purpose is to describe the structure and hierarchy of an entity. This entity could be a strategy, event, software program, and so on. The hierarchy chart is suitable in any situation that aims to present the organized structure of a material or an abstract entity.
Answer:
def ViewRatings(str, rating):
for book in books:
if r >= rating:
print(book)
ViewRatings("emma", 3)
Explanation:
* The code is in Python.
Since the are missing parts in your question. I am assuming there is a books list and there is a rating, r for each book.
- Create a function called ViewRatings that takes two parameters
- Initialize a for loop that iterates through each book in the books list
- For each book, check its rating with given rating. If the rating of the book is greater than or equal to given rating, print the book
- Call the function
The total equivalent resistance, is given as:
Rtotal = R1 + R2 + R3 , where R1 is the resistance of the first resistor, R2 of the second and R3 f the third
bend slightly and stretch your right hand up
move your head back and forward slowly
blink your eyes often