1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
rusak2 [61]
3 years ago
9

What did I do wrong? May you please correct it for me...I was also looking on how to delay when it prints. Like when it prints a

sentence I want it to wait about 2 seconds.
Here's the code:

print("\nWelcome to the impossible quiz!\n")

name = input("What's your name before we get started? ")

print("Nice to meet you, "+ name)

print("\nThe rules are very simple, get the answer right and you get 10 points. You only have one chance to get the answer right, get it wrong and you'll lose 3 points! ")

input("\nReady?\n")

user_score = 0

print("First question: Do slugs have four noses?")
if answer = input('Give "F" for False or "T" for True: ')

if answer == "T":
print("Correct, you've gained 10 points!")
user_score += 10

elif answer == "F":
print("Incorrect, you've lost 3 points!")
user_score += -3

Computers and Technology
1 answer:
inessss [21]3 years ago
4 0

Answer:

print("\nWelcome to the impossible quiz!\n")

name = input("What's your name before we get started? ")

print("Nice to meet you, "+ name)

print("\nThe rules are very simple, get the answer right and you get 10 points. You only have one chance to get the answer right, get it wrong and you'll lose 3 points! ")

input("\nReady?\n")

user_score = 0

print("First question: Do slugs have four noses?")

answer = input('Give "F" for False or "T" for True: ')

if answer == "T":

time.sleep(2)

print("Correct, you've gained 10 points!")

user_score += 10

elif answer == "F":

time.sleep(2)

print("Incorrect, you've lost 3 points!")

user_score += -3

Explanation:

Please check the answer. However, if before answer was wrong, and we need to use time.sleep(2) for delaying printing.

You might be interested in
Due to the difficult economic times, increased global competition, demand for customization, and increased consumer sophisticati
Lunna [17]

Answer:

b. False

Explanation:

Difficult economic times, increased global competition, demand for customization, and increased consumer sophistication does not direct companies to hire more employees and outsource middle managers.

Rather, companies tend to invest new technologies, information systems to satisfy the needs in global competition, consumer sophistication and customization.

Middle managers outsourced cannot deal these issues effectively, therefore they need to be company employees.  

In difficult economic times, companies does not want to hire extra employees because of increased cost.

8 0
3 years ago
Write a method called findNames that meets the following specs: It takes two arguments: a list of strings, allNames, and a strin
Anna11 [10]

Answer:

public class Solution {

   public static void main(String args[]) {

       String[] allNames = new String[]{"Bob Smith", "Elroy Jetson", "Christina Johnson", "Rachael Baker", "cHRis", "Chris Conly"};

       String searchString = "cHRis";

       

       findNames(allNames, searchString);

   }

   

   public static void findNames(String[] listOfName, String nameToFind){

       ArrayList<String> resultName = new ArrayList<String>();

       

       for(String name : listOfName){

           if (name.toLowerCase().contains(nameToFind.toLowerCase())){

               resultName.add(name);

           }

       }

       

       for(String result : resultName){

           System.out.println(result);

       }

   }

}

Explanation:

The class was created called Solution. The second line define the main function. Inside the main function; we initialized and assign an array called allNames to hold the list of all name. Then a String called searchString was also defined. The searchString is the string to search for in each element of allNames array. The two variables (allNames and searchString) are passed as argument to the findNames method when it is called.

The method findNames is defined and it accept two parameters, an array containing list of names and the name to search for.

Inside the findNames method, we initialized and assigned an ArrayList called resultName. The resultName variable is to hold list of element found that contain the searchString.

The first for-loop goes through the elements in the allNames array and compare it with the searchString. If any element is found containing the searchString; it is added to the resultName variable.

The second for-loop goes through the elements of the resultName array and output it. The output is empty if no element was found added to the resultName variable.

During comparison, the both string were converted to lower case before the comparison because same lowercase character does not equal same uppercase character. For instance 'A' is not same as 'a'.

8 0
2 years ago
C++ a. Write a program that uses the function isPalindrome given in example 6-6 (Palindrome). Test your program on the followinn
Whitepunk [10]

Answer:

#include <iostream>

#include <array>

using namespace std;

bool isPalindrome(string str)  

{  

int length = str.length();  

for (int i = 0; i < length / 2; i++)  

 if (toupper(str[i]) != toupper(str[length - 1 - i]))

  return false;  

return true;  

}

int main()

{

array<string, 6> tests = { "madam", "abba", "22", "67876", "444244", "trymEuemYRT" };

for (auto test : tests) {

 cout << test << " is " << (isPalindrome(test) ? "" : "NOT ") << "a palindrome.\n";

}

}

Explanation:

The toupper() addition forces characters to uppercase, thereby making the comparison case insensitive.

5 0
3 years ago
Could somebody please find the bugs and amend them? This question is worth 25 Brainly points!
Andreyy89

line 4

if salary < 30000

error missing ":"

solution

if salary < 30000:

line 6

tax = salary * 0.2

error is missing identifier for tax

solution add identifier for tax on line 3

tax = 0.0

line 11

error syntax

solution is move tax = salary * 0.4 + 6000 to the right

tax = salary * 0.4 + 6000

6 0
3 years ago
An Operating System is an application just like any other applications we use on our computers. What makes an Operating System s
tatyana61 [14]

Answer: An operating system(OS) is an interface between the hardware and the user. An OS is built so that it could support other software. OS is a system software which is used to support other application softwares.

Explanation:

An operating system handles all the hardware of the system and allows users access to those hardware components with the help of application softwares.

An OS consist of many libraries and APIs which allows programmers to write and execute codes. There are many types of OS such as real time, multitasking, multi programming OS.

The OS is responsible for allocating memory, managing the hardware, distributing resources across different processors in an distributed system.

So all these features makes them different from application software. The OS is responsible allocating memory and hardware resources to these softwares.

3 0
3 years ago
Other questions:
  • Clicking on the Spelling &amp; Grammar button is one way to correct a spelling error in Word. Please select the best answer from
    7·2 answers
  • Wich technology can a website use to allow you to listen to a concert live over the internet?
    10·1 answer
  • What type of game is LEAST LIKELY to need a structured narrative?
    6·1 answer
  • Which of the following can a cell contain?
    9·2 answers
  • How are comments in a Java program treated by the compiler?
    14·2 answers
  • Suppose that the first goal in a GP problem is to make 3 X1 + 4 X2 approximately equal to 36. Using the deviational variables d1
    15·1 answer
  • What's the smallest part of a computer
    8·2 answers
  • What is the scope of each variable?
    11·2 answers
  • If each integer occupies one 64-bit memory cell and is stored using sign/magnitude notation, what are the largest (in terms of a
    12·1 answer
  • to allow excel to change the cell references in a formula or function from row to row or column to column as you fill with it, y
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!