answer.
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
Ivahew [28]
2 years ago
7

Write a loop that reads strings from standard input, where the string is either duck or goose. the loop terminates when goose is

read in. after the loop, your code should print out the number of duck strings that were read.
Computers and Technology
1 answer:
Misha Larkins [42]2 years ago
4 0
Have in mind that the following code is ofr C++ but I know that whatever the language you are using, you can use the same idea:

<span><iostream> 
using namespace std; 
int main() 
{ 
int count=0; 
string x; 
while(1) 
{ 
cout<<"Enter either goose or duck"; 
cin>>x; 
if ( x=="Goose") break; 
count++; 
} 

cout<<"Number of Ducks="<<count<<endl; 
return 0; 
}
</span>
Another one that is simplier but the language is python is:
counter = 0while True:  line = input()if line == 'duck':  counter += 1    elif line == 'goose':breakprint(counter)
You might be interested in
___________ device that uses a light source to read characters, marks, and codes and then converts them into digital data that a
kaheart [24]

Answer: Optical Reader

Explanation:

4 0
2 years ago
Dante has a worksheet shared with multiple users. He would like the ability to approve or reject changes that are made. Which fe
Gemiola [76]

Answer:

Data Consolidation.

Explanation:

7 0
2 years ago
IDaaS is a ________-based identity and access management offering.
Andre45 [30]

Answer:

c) SaaS

Explanation:

Identity as a Service is a company that provides authentication to access the data or resources to the ensured user. They provide access to the ensured users and helps in securing the data from any unauthorized involvement. The process of authentication is cloud-based and is available only for the subscribed users.

8 0
2 years ago
(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the arr
Mashutka [201]

Answer:

weights = []

total = 0

max = 0

for i in range(5):

   weight = float(input("Enter weight " + str(i+1) + ": "))

   weights.append(weight)

   total += weights[i]

   if weights[i] > max:

       max = weights[i]

average = total / 5

print("Your entered: " + str(weights))

print("Total weight: " + str(total))

print("Average weight: " + str(average))

print("Max weight: " + str(max))

Explanation:

Initialize the variables

Create a for loop that iterates 5 times

Get the values from the user

Put them inside the array

Calculate the total by adding each value to the total

Calculate the max value by comparing each value

When the loop is done, find the average - divide the total by 5

Print the results

6 0
2 years ago
Allan needs to ensure that an object is in a very precise location on a slide. He decides to use the Ruler option to achieve thi
shusha [124]

Answer:

It can be found on View tab.

Explanation:

The view tab on Microsoft Power point is the 9th tab when counting from the left. When clicked, the view tab displays a number of tools that are aimed at visualizing how slides appear.

The ruler function is one of those tools. It is used to ensure that an object is placed or appears at a specific location in the slides. The ruler tool can be found in the Show Box which is the third box from left after Presentation View and Master View.

8 0
2 years ago
Read 2 more answers
Other questions:
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • The it department is reporting that a company web server is receiving an abnormally high number of web page requests from differ
    13·1 answer
  • Characteristics of a LAN include _____. can be connected to the Internet covers the most area of all networks does not have to b
    5·1 answer
  • A company wants to inform a select list of it's regular customers about a flash sale. Which type of platform will it use to send
    9·1 answer
  • Why would someone need to use tools like IECacheView or MyLastSearch on a system? Do companies have the right to search a workst
    11·1 answer
  • _____ computing refers to a computing environment that is always present, can feel our surroundings, and-based on who we are, wh
    8·1 answer
  • You're the sole IT employee at your company. Most of the computers in your fleet are Windows machines. Your boss wants you to se
    11·1 answer
  • Program documentation _____. Group of answer choices describes the inputs, outputs, and processing logic for all program modules
    6·1 answer
  • You are trying to appreciate how important the principle of locality is in justifying the use of a cache memory, so you experime
    11·1 answer
  • A process is moved to wait queue when I/O request is made with:_______ A. non-blocking I/O B. blocking I/O C. asynchronous I/O D
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!