Write a program that repeatedly reads in integers until a negative integer is read. The program keeps track of the largest integer that has been read so far and outputs the largest integer when the (first) negative integer is encountered. (See subsection Example: Finding the max value of section 4.1 Loops (general) to practice the algorithm).

Answers

Answer 1

Answer:

In Python:

num = int(input("Enter number: "))

maxn = num

while num >=0:

   if num>maxn:

       maxn = num

   num = int(input("Enter number: "))

print("Largest: "+str(maxn))

Explanation:

Get input from the user

num = int(input("Enter number: "))

Initialize the largest to the first input

maxn = num

This loop is repeated until a negative input is recorded

while num >=0:

If the current input is greater than the previous largest

   if num>maxn:

Set largest to the current input

       maxn = num

Get another input from the user

   num = int(input("Enter number: "))

Print the largest

print("Largest: "+str(maxn))


Related Questions

What is a typical use for a MAN?

A.
to connect devices in five offices adjacent to each other
B.
to connect computers across a university campus
C.
to connect corporate offices across three continents
D.
to connect the computers in a private library

Answers

A.to connect devices in five offices adjacent to each other

Answer:

B. to connect computers across a university campus

Explanation:

Plato correct!

You are setting up a small network. The customer has decided to change his internet service provider (ISP) to EtherSpeed. The ISP has installed a connection to both RJ45 jacks on the wall plate. You are responsible for selecting the correct router to connect the network to the internet. You want to use the fastest connection speed available while providing for security for both the Home-PC and Home-PC2 computers.

Your task is to complete the following:

⢠Use the appropriate network components to connect the two computers to the new ISP.
⢠Place the Ethernet router with firewall capabilities on the Workspace.
⢠Use the existing Cat5e Ethernet cables to connect the computers to the router's integrated Ethernet LAN ports.
⢠Use the AC to DC power adapter to plug in the device.
⢠Use the Network and Sharing Center on both computers to confirm that the computers are properly connected to the network and internet.

Answers

Home pc1 becouse it is the right one

Match each term in the second column with its correct definition in the first column. Write the letter of the term on the blank line in front of the correct definition. A chart that shows the relationship of each part to a whole. A what-if analysis tool that find the input needed in one cell to arrive at the desired result in another cell. In a formula, the address of a cell based on the relative position of the cell that contains the formula and the cell referred to in the formula. A column, bar, area, dot, pie slice, or other symbol in a chart that represents a single data point. A workbook sheet that contains only a chart. A shape effect that uses shading and shadows to make the edges of a shape appear to be curved or angled. The entire chart and all of its elements. The process of changing the values in cells to see how those changes affect the outcome of formulas in a worksheet. The mathematical formula to calculate a rate of increase. The mathematical rules for performing multiple calculations within a formula. The Excel feature which, after typing - and the first letter of a function, displays a list of function names. A line that serves as a frame of reference for measurement and that borders the chart plot area. The area along the bottom of a chart that identifies the categories of data; also referred to as the x-axis. A numerical scale on the left side of a chart that shows the range of numbers for the data points; also referred to as the y-axis. The formula for calculating the value after an increase by multiplying the original value the base by the percent for new value.

Answers

Answer:

1. Pie chart.

2. Goal seek.

3. Relative reference cell.

4. Data marker.

5. Chart sheet.

6. What-If-Analysis.

7. [tex] Rate = \frac {Amount \; of \; increase}{Base} [/tex]

8. Order of operations.

9. Formula AutoComplete.

10. Axis.

11. Category axis.

12. Value axis

13. [tex] Value \; after \; increase = Base * Percent \; for \; new \; value [/tex]

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

Some of the terminologies and features of the Microsoft Excel software includes the following;

1. Pie chart: a chart that shows the relationship of each part to a whole.

2. Goal seek: a what-if-analysis tool that finds the input needed in one cell to arrive at the desired result in another cell.

3. Relative reference cell: in a formula, the address of a cell based on the relative position of the cell that contains the formula and the cell referred to in the formula.

4. Data marker: a column, bar, area, dot, pie slice, or other symbol in a chart that represents a single data point.

5. Chart sheet: a workbook sheet that contains only a chart.

6. What-If-Analysis: the process of changing the values in cells to see how those changes affect the outcome of formulas in a worksheet.

7. [tex] Rate = \frac {Amount \; of \; increase}{Base} [/tex]: The mathematical formula to calculate a rate of increase.

8. Order of operations: the mathematical rules for performing multiple calculations within a formula.

9. Formula AutoComplete: the excel feature which, after typing - and the first letter of a function, displays a list of function names.

10. Axis: a line that serves as a frame of reference for measurement and that borders the chart plot area.

11. Category axis: the area along the bottom of a chart the identifies the categories of data, also referred to as the x-axis.

12. Value axis: a numerical scale on the left side of a chart that shows the range of numbers for the data points, also referred to as the y-axis.

13. [tex] Value \; after \; increase = Base * Percent \; for \; new \; value [/tex]: the formula for calculating the value after an increase by multiplying the original value the base by the percent for new value.

please help me :)
Consider the program segment below. Assume k is a positive number.

for (int i = 2; i <= k; i++)
if (nums[i] < someValue)
System.out.println("FOUND");
What is the maximum number of times FOUND can be printed?

Group of answer choices

k - 1

1

0

k

k - 2

Answers

Answer:

k - 1 times

Explanation:

Given

The attached code snipped

Required

Maximum number of times, the print statement is executed

From the iteration, we have: i = 2; i<=k; i++

This means that; i = 2 to k

Say: [tex]k = 5[/tex]

[tex]i = 2, 3,4,5[/tex] (4 values) i.e. 5 - 1

Say [tex]k = 10[/tex]

[tex]i = 2,3,4,5,6,7,8,9,10[/tex] (9 values) i.e. 10 - 1

So, the maximum number of times is k - 1

Which two of the following are conditions of AI programming that enable robots to either accept or reject commands from humans?
Group of answer choices

equality principle

knowledge

semantic manipulation

enhanced circuitry

capacity

Answers

knowledge and capacity

hope this helps :)

You have a project that requires you to work in a team setting. You know of a developer who has the credentials you
need, works well in a team, and does not need supervision to get the job done. The problem is that the developer is not
within your geographic location. One solution is to allow the developer to blank
full-time.

Answers

Answer:

work remotely

Explanation:

The best solution would be to allow the developer to work remotely full-time. This means that they would be working from home all the time and would most likely communicate with the rest of the team via other means. Usually, unimportant communication would be done through e-mail while important issues and team meetings would be done through video conference. This will allow you to hire this developer and add him/her to the team without having to worry about any issues arising due to transportation.

What are possible penalties if a designer is caught breaking copyright laws?

Select all that apply.


removing the design from internet
having a work computer confiscated
losing access to software programs
paying fines to copyright owner

Answers

Answer:

1 and 4 are the correct answers.

Explanation:

After Sally adds the Print Preview and Print command to the Quick Access Toolbar, which icon would she have added? the icon that shows an open folder the icon that shows a sheet of paper the icon that shows a printer with a check the icon that shows a sheet of paper and a magnifying glass

Answers

Answer: the icon that shows a sheet of paper and a magnifying glass

Explanation:

The Quick Access Toolbar, gives access to the features that are usually used like Save, Undo/Redo. It can also be customized such that the commands that the users usually use can be placed quicker and therefore makes them easier to use.

After Sally adds the Print Preview and Print command to the Quick Access Toolbar, the icon that she would have added is the icon that shows a sheet of paper and a magnifying glass.

Answer:

d

Explanation:

Think of—and explain—one or more ways that society could use big data

Answers

Answer:

Naumann noted there are many positive ways to use big data, including weather prediction, forecasting natural disasters, urban and community planning, traffic management, logistics and machine efficiency, personalized healthcare, customized learning, autonomous vehicles, fraud detention, robotics, translation, smart ...

Internal memory is synonymous with which memory

Answers

Answer:

Main Memory (RAM)

Explanation:

This is the memory which is directly accessible to the CPU. It can be called Main Memory, Prime Memory or simply 'Memory'

Answer:

the answer is Main Memory

Explanation:

David Karp is credited with the invention of which microblogging service?

Answers

Answer:

On February 19, 2007, the first version of the Tumblr microblogging service was founded by David Karp and Marco Arment. They launched a more complete version in April 2007.

Explanation:

More than 100 million blogs will be online in 2007. The count continues to double every 5.5 months. About half of the blogs created are ever maintained after being created. And fewer than 15% of blogs are updated at least once a week. (Technorati)

….Yeah, it’s still a blog. But it’s a new philosophy. It’s free of noise, requirements, and commitments. And it’s finally here.

let me know if that is good enough

1
Q9. Which tool is used to cancel the
action of undo tool ? *

Answers

Answer:

hold down CTRL + Z and it will reverse to the last action

how to make windiws 10 to wundows 21?​

Answers

Answer:

You multiply it.

Which of the following pieces of evidence was NOT used to support the Theory of Continental Drift?

A.The shape of the continents appears to fit together like a puzzle.
B.Identical fossils have been found on multiple continents separated by oceans.
C.Similar landforms are continuous between two continents when matched up.
D.There were traces of land bridges connecting separate continents.
There were traces of land bridges connecting separate continents.

Answers

I think that the answer is D pretty sure

The pieces of evidence that is not used as support is that There were traces of land bridges connecting separate continents.

How did the continents separate and drift apart?

The rotation of the Earth is known to be the reason for the continents to move towards and also apart from each other. .

Therefore, The pieces of evidence that is not used as support is that there were traces of land bridges connecting separate continents.

Learn more about Continental Drift from

https://brainly.com/question/394265

#SPJ6

Software that is downloaded from the internet fits into four categories what are they

Answers

Answer:

Application Software

Driver Software.

System Software

Programming Software

Answer:

application, system,driver and programming software

A method signature for a method consists of all elements of the method except the body. That is, a method signature consists of the privacy, (non-)static, return datatype, method name, and formal parameters. Consider the ceiling method as an example.
public static int ceiling (double num)
{
return num <= 0 ? (int) num: (int) num + 1;
}
The method signature of the ceiling method is the first line of the method: public static int ceiling (double num). In this example, we note that ceiling is static because it is a standalone method and does not require an object to invoke (since we are not acting on an instance of a class).
For parts a - d, give the method signature described by the scenario.
a) A method in class String that returns the reversed version of the current String.
b) A method that returns the maximum of two given integers.
c) A method that returns true or false if the input integer is an even number.
d) A default constructor for class Table.

Answers

To be honest I feel like it’s B that’s looks and seems the most correct to me

A sql-6-5.sql file has been opened for you. Write each of the following tasks as a SQL statement in a new line (remember that you can source the file to compare the output reference): Use the e_store database Select the total stock of all products in the products table. Alias the column name as total_stock. The resulting table should look like this:

Answers

Answer:

The query is as follows:

select sum(stock) as total_stock from products

Explanation:

Required

Return total stock using the alias total_stock from the product table.

The explanation of the query is as follows:

select ----> This implies that data is to be selected from the table

sum(stock) ----> This adds up entries in stock column

as total_stock ---> This represents the alias used for sum(stock)column where

from products  ----> The table being queried

Take for instance, the content of the table is:

SN  Product Stock

1      Apple     5

2     Orange   3

3      Banana   8

The query will return the following table:

total_stock

16

A program spends 30% of its time performing I/O operations, 25% of its time doing encryptions, and the remaining 45% of its time doing general computations. The user is considering purchasing one of three possible enhancements, all of which are of equal cost: (a) a new I/O module which will speed up I/O operations by a factor of 2, (b) adding encryption hardware which will cut the encryption time by 70%, and (c) a faster processor which will reduce the processing time for both general computations and encryptions by 40%. Which of these three enhancements will provide the best speedup? Hint: This is an application of Amdahl’s Law.

Answers

Answer:

a

Explanation:

what The computer needs both
and
to
function properly?​

Answers

Answer:

It needs power in order to function

Explanation:

A bank is developing an algorithm that will help them decide who to make loans to. As input the algorithm will consider information about the person applying for the loan and the amount of money requested, and as output the algorithm will decide whether the bank should give that loan.
The bank intends to develop the algorithm using machine learning techniques. The algorithm will be trained using data from past loan decisions made by human bankers.
Which of the following best describes whether this algorithm will include bias?
Group of answer choices
A. While the algorithm may be biased, the eventual decision made the algorithm will not be
B. The algorithm will not be biased because using machine learning eliminates human biases
C. Machine learning algorithms cannot be developed using biased data so if there is bias in the data it will be impossible to develop the algorithm
D. The algorithm will likely reflect the human biases in the data used to train it
E. The histogram chart below has a single bar for every state in the United States. Each state is placed in a bucket, or range, based on its area in square miles.

Answers

Answer: A

Explanation:

Just took this and got it right

Answer:

The answer is D

Explanation:

Since it is made by humans there will surely be bias in making the algorithm and the algroithm will reflect that bias from the people that made it. Also I got this question and I got it right.

In 5-6 sentences explain how technology has impacted engineers.

Answers

Answer:

gissa vem som är tillbaka, tillbaka igen

Explanation:

translate it pls

draw
b. When you start Microsoft Word, a blank document
appears with the name Document1 in the title bar. is it true or false​

Answers

Answer:

it is true,a blank document appears with the name Document 1

Summary
In this lab, you use what you have learned about searching an array to find an exact match to complete a partially prewritten C++ program. The program uses an array that contains valid names for 10 cities in Michigan. You ask the user to enter a city name; your program then searches the array for that city name. If it is not found, the program should print a message that informs the user the city name is not found in the list of valid cities in Michigan.
The file provided for this lab includes the input statements and the necessary variable declarations. You need to use a loop to examine all the items in the array and test for a match. You also need to set a flag if there is a match and then test the flag variable to determine if you should print the the Not a city in Michigan.message. Comments in the code tell you where to write your statements. You can use the previous Mail Order program as a guide.
Instructions
Ensure the provided code file named MichiganCities.cppis open.
Study the prewritten code to make sure you understand it.
Write a loop statement that examines the names of cities stored in the array.
Write code that tests for a match.
Write code that, when appropriate, prints the message Not a city in Michigan..
Execute the program by clicking the Run button at the bottom of the screen. Use the following as input:
Chicago
Brooklyn
Watervliet
Acme
// MichiganCities.cpp - This program prints a message for invalid cities in Michigan.
// Input: Interactive
// Output: Error message or nothing
#include
#include
using namespace std;
int main()
{
// Declare variables
string inCity; // name of city to look up in array
const int NUM_CITIES = 10;
// Initialized array of cities
string citiesInMichigan[] = {"Acme", "Albion", "Detroit", "Watervliet", "Coloma", "Saginaw", "Richland", "Glenn", "Midland", "Brooklyn"};
bool foundIt = false; // Flag variable
int x; // Loop control variable
// Get user input
cout << "Enter name of city: ";
cin >> inCity;
// Write your loop here
// Write your test statement here to see if there is
// a match. Set the flag to true if city is found.
// Test to see if city was not found to determine if
// "Not a city in Michigan" message should be printed.
return 0;
} // End of main()

Answers

Answer:

Replace the comments with:

for(x = 0; x < NUM_CITIES; x++){

      if(inCity == citiesInMichigan[x]){           foundIt = true;}

  }

  if(foundIt){ cout<<"Exists";}

  else{cout<<"Does not exists";}  

 

Explanation:

This iterates through the cities

[tex]for(x = 0; x < NUM\_CITIES; x++)\{[/tex]

This checks if current city in the array matches the city input by the user

[tex]if(inCity == citie sIn Michigan[x])\{[/tex]           foundIt = true; If yes, foundIt is set to true}

  }

If foundIt is true, print "Exists"

if(foundIt){ cout<<"Exists";}

If foundIt is false, print "Does not Exists"

  else{cout<<"Does not exists";}  

See attachment for complete program

What type of web provides a framework that allows data to be shared and reuse to deliver
web content specifically targeting the user?

Answers

Answer:

Semantic Web

Explanation:

The Semantic Web provides a common framework that allows data to be shared and reused across application, enterprise, and community boundaries. It is a collaborative effort led by W3C with participation from a large number of researchers and industrial partners.

Calculate The Average of Grades Instructions:
Please read the following problem carefully. You will then logon on to https://www.draw.io/to create a professional diagram. You will put all titles, labels, and save your work using the information below. Please follow the directions:
Destini would like to get a better understanding of her grades in all of her college courses before Spring Break. Instead of using a calculator and paper to calculate her grade, she decided to design a program. She will design a program that will ask her to enter her course name and the number of grades in her grade book. The program will then Read the number of Grades based on what was entered by her, Add up all the Grades, Calculate the Average, and Display Course Name and the Average to Screen. It is important to consider that the number of grades will be different for each course. Using Repetition Control, please design this program.
1. Please Create Flowchart using Draw.10 and Simple Flowchart symbols only (Draw.IO)
2. Pseudocode.
Your unique Flowchart must have the following (See Example Here):
A. Name, Date, and class Name [Top Left of Flowchart)
B. A Title of the Flowchart in Bold [Centered at the top of your flowchart)
C. A Brief Summary of your Flowchart (2 to 3 short sentences describing your flowchart) [Left of Flowchart]

Answers

Answer:

The pseudocode is as follows:

Input coursename, numgrades

count = 1; totalgrades = 0

while count <= numgrades:

   input grade

   totalgrade+=grade

   count++

average = totalgrade/count

print(coursename)

print(average)

Explanation:

The solution is as follows:

(1) See attachment for flowchart

(2) See answer section for pseudocode

Explanation

Input coursename and number of grades

Input coursename, numgrades

Initialize count of grades input by the user to 1 and the sum of all grades to 0

count = 1; totalgrades = 0

This loop is repeated while count of grades input by the user is less than or equal to the numgrades

while count <= numgrades:

Input grade

   input grade

Add grades

   totalgrade+=grade

Increase count by 1

   count++

End of loop

Calculate average

average = totalgrade/count

Print coursename

print(coursename)

Print average

print(average)

C. Summary of the flowchart

The flowchart gets coursename and the number of grades from the user. Then it gets the score of each grade, add them up t calculate the average of grades.

Lastly, the course name and the average grades is printed

what are the different cpu sockets?

Answers

Answer:

Intel Is Somethings mainley LGA 1151, 1155, 1125 Etc.

On the other hand there are AMD sockets mainley in past gens there are am2 am3 now its am4 and so on hope this helped!

Explanation:

Select the device that will have the most network ports

1. Switch
2. Server
3. Laptop
4. Desktop

Answers

Answer:

desktop

Explanation:

what is file system manipulation​

Answers

Answer:

Program requires to read a file or write a file. Operating system gives the permission to the program for operation on file. ... The Operating System provides an interface to the user to create/delete files and directories. The Operating System provides an interface to create the backup of file system.

To view a friend's calendar, you must request access.
A) True
B) False

Answers

Answer:

True the answer is true

Explanation:

I hope this helps

Answer:

True?

Explanation:

A police department wants to maintain a database of up to 1800 license-plate numbers of people who receive frequent tickets so that it can be determined very quickly whether or not a given license plate is in the database. Speed of response is very important; efficient use of memory is also important, but not as important as speed of response. Which of the following data structures would be most appropriate for this task?

a. a sorted linked list
b. a sorted array with 1,800 entries
c. a hash table using open addressing with 1,800 entries
d. a hash table using open addressing with 3,600 entries
e. a hash table using open addressing with 10,000 entries

Answers

Answer:

c.

Explanation:

I believe that in this scenario, the best option for this data would be a hash table using open addressing with 1,800 entries. Hash tables consume more memory than lists but it makes up for it with much faster response time speeds. This is because hash tables work on a key:value system therefore, the license plate can easily be grabbed from the database extremely quickly by just plugging in the plate number. Doing so will retrieve all of the saved information from that license plate. That is why hash tables have a constant time complexity of O(1)

The data structures that would be most appropriate for this task is; D: a hash table using open addressing with 3,600 entries

What is the Importance of Hash Tables?

A hash table is also called a hash map and is defined as a data structure that implements an associative array abstract data type which is basically a structure that can map keys to values.

A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets onto a platform that the desired value can be found.

From the above definitions of a hash function and looking at the question, we can say that the data structure that would be most appropriate for the given task is a hash table using open addressing with 3,600 entries.

Read more about hash table at; https://brainly.com/question/4478090

Other Questions
Hurry need help on number 1 fast pls pls pls!!! A 180 pound weight is supported by two ropes each at 30 degrees, as shown in the figure. Find the tension in each rope. According to LeChtelier's principle, how will an increase in concentration of a reactant affect the equilibrium system?Shift it toward the productsO Shift it toward the reactantsO Shift it toward the side with higher total mole concentrationO Shift it toward the sidewith lower total mole concentration Prior to the early twentieth century, a worker who was injured on the job could collect damages only by suing his employer. To sue successfully, the workeror his family, if the worker had been killedhad to show that the injury was due to the employer's negligence, that the worker did not know the job was hazardous, and that the worker's own negligence had not contributed to the accident. These lawsuits were difficult for workers to win, and even workers who had been seriously injured on the job often were unable to collect any damages from their employers. Beginning in 1910, most states passed "workers' compensation" laws that required employers to purchase insurance that would compensate workers for injuries suffered on the job. A study by Price Fishback and Shawn Kantor of the University of Arizona shows that after the passage of workers' compensation laws, wages received by workers in the coal and lumber industries fell.Required:Briefly explain why passage of workers compensation laws would lead to a fall in wages in some industries. Please find the area of the trapezoids.By the way, the answer is NOT 10.5. Explain how 17.526 could be rounded to both 18 and 17.5. Can someone solve this with explaining it 50 POINTS: Please help thank you so much!! (Image attached) The polygons are similar. Find the values of the variables.I know from the answer key that the answers are x=3 \sqrt{10}310and y=2 \sqrt{10}210but I'm not sure how to get there... If you were to describe America, what would you describe? In one word The Treaty of Moultrie Creek gave the Seminoles four million acres of land in a reservation south of modern Ocala.O TrueO False Please help its due tonight. Your help will be greatly appreciated.There is also a graph. WILL PUT YOU AS BRAINLY!!!!!! Please help me!!! This is timed!!! I GIVE BRAINLIEST!!!!Who was partly responsible for the development of the scientific method?O Francis BaconO Galileo GalileiO Johannes KeplerO Nicolaus Copernicus Show how to use substitution or elimination to solve the following system of equations. Write your solution as an ordered pair:7x + y = 5 , 7x + y = -2( , )And please tell me if you used substitution or elimination. TYSM HELPPPPPP PLEASE nenndjdjxididnnd Find the probability of selecting a vowel from the word MATHEMATICS [please help!!!!] Which statements about braking a car are true?The greater the kinetic energy of a car, the longer it takes for the car to stop.The lower the kinetic energy of a car, the longer it takes for the car to stop.If the speed of a car doubles, the cars kinetic energy and braking distance quadruple.If the speed of a car doubles, the cars kinetic energy and braking distance remain the same. Decrease $260 in the ratio 3:5 PLEASE HELP !! ILL GIVE BRAINLIEST !! Surface Area6. Answer the question above (use 3.14 for pi): Solve the given equation.z - 42 = 7