Write an algorithm to sum to values

Answers

Answer 1

Answer:

There is no need to make an algorithm for this simple problem. Just add the two numbers by storing in two different variables as follows:

Let a,b be two numbers.

c=a+b;

print(c);

But, if you want to find the sum of more numbers, you can use any loop like for, while or do-while as follows:

Let a be the variable where the input numbers are stored.

while(f==1)

{

printf(“Enter number”);

scanf(“Take number into the variable a”);

sum=sum+a;

printf(“Do you want to enter more numbers? 1 for yes, 0 for no”);

scanf(“Take the input into the variable f”);

}

print(Sum)

Explanation:

hi there answer is given mar me as brainliest


Related Questions

Does anyone know how to fix this? Everytime i make a new page it only types in the middle of the page. I want to type at the top

Answers

Answer:maybe start a new page or try hitting delete

Explanation:

write a java program to input two double type numbers and by using suitable mathematical functions print the maximum and minimum numbers out of the two numbers.
[tex]java \: me \: likhna \: ok[/tex]

Answers

Answer:

The program in Java is as follows:

import java.util.Scanner;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 double n1, n2;

 n1 = input.nextDouble();

 n2 = input.nextDouble();

 double Max = Math.max(n1,n2);

 double Min = Math.min(n1,n2);

 System.out.println("Max: "+Max);

 System.out.println("Min: "+Min); }}

Explanation:

This declares the numbers

 double n1, n2;

This gets input for n1

 n1 = input.nextDouble();

This gets input for n2

 n2 = input.nextDouble();

This gets the max of both using the max function

 double Max = Math.max(n1,n2);

This gets the min of both using the min function

 double Min = Math.min(n1,n2);

This prints the max

 System.out.println("Max: "+Max);

This prints the min

 System.out.println("Min: "+Min);

A data analyst is using the Color tool in Tableau to apply a color scheme to a data visualization. They want the visualization to be accessible for people with color vision deficiencies, so they use a color scheme with lots of contrast. What does it mean to have contrast

Answers

Answer:

Color contrast is the difference in light between font (or anything in the foreground) and its background.

Explanation:

In web accessibility, how well one color stands out from another color determines whether or not most people will be able to read the information.

Contrast makes things look different and stand out

Which of the following passes an int argument into a method named print? Chose one option and explain why.

o print();
o print()+5;
o print("5");
o print(5);

Answers

Answer:

print(5)

Explanation:

Passing an int argument into the method named print ;

print() ; Here, the print method has no argument as it is empty

print()+5; Here also, the print method has no argument and adding +5 is an invalid syntax.

print("5") ; Here, print takes in an argument, however, the argument is a string due to the fact that 5 is enclosed by quotation marks.

print(5) ; Here, the integer is 5 is passed to the print method.

Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate's name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election.
i have this
#include
#include
#include
using namespace std;
int findMax(int votes[]);
void main()
{
int votes[20];
string name[10];
int total=0;
float percent[10];
int m, i, loc;
cout<<"Enter the names of candidates in local election and number of votes:"< for(int i=0;i<5;i++)
{
cin>>name[i];
cin>>votes[i];
}
for(i=0;i<5;i++)
{
total=total+votes[i];
}
for(i=0;i<5;i++)
{
percent[i]=((votes[i]/total)*100);
}
cout<<"Candidate"<<'\t'<<"VotesReceived"<<'\t'<<"% of Total Votes"< cout< for(i=0;i<5;i++)
{
cout< }
cout<<"Total:"< m=findMax(votes);
cout<<"Winner of the election is"< system("pause");
}
int findMax(int votes[])
{
int i,max,loc;
max=votes[0];
for(i=1;i<5;i++)
{
if(votes[i]>max)
{
max=votes[i];
loc=i;
}
}
return loc;
}
But, it is saying that loc is not initialized, and it is also not calculating % of total votes or the winner of the election and I don't what to do to fix it.

Answers

Answer:

The following fix were made to the program

Change void main() to int main(), then set a return value at the end of the main function;  e.g. return 0Remove system("pause");  It's not neededFor each of the array, change their lengths to 5 i.e. int votes[5];  string name[5];   and float percent[5];Lastly, calculate the percentage using: percent[i]=((votes[i]*100.0/total))

Explanation:

(1) void main implies that the main function will not return any value. So, you change it to int main() and then set the return value

(2) There is no need to pause the program, so system.("pause") is not necessary.

(3) The question says there are 5 candidates. So, we set the arrays to accommodate inputs for 5 values

(4) percent array is declared as float; 100.0 will ensure that it calculates the percentage as a float value.

See attachment for updated code

Which year was the Apple 2 released?
A) 1979
B). 1973
C). 1980
D). 1977​

Answers

Answer:

1977

Explanation:

Apple 2 was released in April 19th 1977

it was released April 1977

What is not an advantage of a computer network?


Select one:

A.Remote Information Access

B.Interaction among cooperative application programs

C.Social Engineering

D.User Communication

E.Resource Sharing​

Answers

Answer:

C. Social Engineering

Explanation:

Social engineering can be defined as an art of manipulating people, especially the vulnerable to divulge confidential information or performing actions that compromises their security.

Basically, it is a manipulative strategy or technique that involves the use of deceptive and malicious activities on unsuspecting victims in order to gain unauthorized access to their confidential or private information for fraud-related purposes. Some examples of social engineering attacks include quid pro quo, spear phishing, baiting, tailgating, water-holing, vishing, pretexting, phishing, etc.

Phishing is an attempt to obtain sensitive information such as usernames, passwords and credit card details or bank account details by disguising oneself as a trustworthy entity in an electronic communication usually over the internet.

Furthermore, phishing is a type of fraudulent or social engineering attack used to lure unsuspecting individuals to click on a link that looks like that of a genuine website and then taken to a fraudulent web site which asks for personal information.

In conclusion, social engineering being a form of cyber attack is not an advantage of a computer network.

what is mobile computing​

Answers

Explanation:

Mobile computing is human–computer interaction in which a computer is expected to be transported during normal usage, which allows for the transmission of data, voice, and video. Mobile computing involves mobile communication, mobile hardware, and mobile software. ... Hardware includes mobile devices or device components.

Question: what is mobile computing

Answer:

Mobile computing is human–computer interaction in which a computer is expected to be transported during normal usage, which allows for the transmission of data, voice, and video. Mobile computing involves mobile communication, mobile hardware, and mobile software. Communication issues include ad hoc networks and infrastructure networks as well as communication properties, protocols, data formats, and concrete technologies. Hardware includes mobile devices or device components. Mobile software deals with the characteristics and requirements of mobile applications.

Explanation:

Hope it helps

#CarryOnLearning

Write a program named split_me.py that accepts a string in the format Age.FirstName and returns the value FirstName is Age years old. Length of Mary is X. Example: 22.Mary >> Mary is 22 years old. Length of Mary is 4

Answers

age,name = input('Enter a string: ').split('.')

print(name+' is '+age+' years old. Length of '+name+' is '+str(len(name)))

I wrote my code in python 3.8. I hope this helps.

A program developed for a Web store represents customer account balances using a format that approximates real numbers. While testing the program, a software developer discovers that some values appear to be mathematically imprecise. Which of the following is the most likely cause of the imprecision?
A. The account balances are represented using a fixed number of bits, resulting in overflow errors.
B. The account balances are represented using a fixed number of bits, resulting in round-off errors.
C. The account balances are represented using an unlimited number of bits, resulting in overflow errors.
D. The account balances are represented using an unlimited number of bits, resulting in round-off errors.

Answers

Answer:

B.

Explanation:

The most likely reason for this would be that the account balances are represented using a fixed number of bits, resulting in round-off errors. Since all of the numbers being used are real numbers they would have a fixed 32 bits of data. When these values are multiplied or divided they can be irrational numbers that never end, and therefore are cut off in order to fit the available data. This would cause the numbers to be rounded and can lead to the answer being imprecise.

three basic components to cloud computing are client, internet

Answers

Answer:

the basic components of cloud comuting in a simple topology

What tells the hardware what to do and how to do it?
Central Processing Unit (CPU)

Software

Hardware

Hard Drive (HDD)

Answers

Answer:

Software

Explanation:

The software tells the hardware what to do and how to do it.

the software tells it what to do and how to do becuase hard ware is just a name and a hard drive contains the soft ware wch tells the hard wear what to do and how to do it

what are three limitations of computer?​

Answers

Answer:

Explanation:

Three limittaions of computer are:

It requires reqular power supply to operate .

It needs instructions to perform a task.

It cannot memorize and recall.

Define a method pyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volume of a pyramid with a rectangular base. Relevant geometry equations: Volume

Answers

Question:

Define a method pyramidVolume with double parameters baseLength, baseWidth, and pyramidHeight, that returns as a double the volume of a pyramid with a rectangular base. Relevant geometry equations:

Volume = base area x height x 1/3

Base area = base length x base width.

(Watch out for integer division)

import java.util.Scanner;

public class CalcPyramidVolume {

   /* Your solution goes here */

   public static void main (String [] args) {

     System.out.println("Volume for 1.0, 1.0, 1.0 is: " + pyramidVolume(1.0, 1.0,   1.0));

     return;

    }

}

Answer:

import java.util.Scanner;

public class CalcPyramidVolume {

   /* Your solution goes here */

   public static void main (String [] args) {

       System.out.println("Volume for 1.0, 1.0, 1.0 is: " + pyramidVolume(1.0, 1.0, 1.0));

       return;

   }

   

   //Begin method definition

   public static double pyramidVolume(double baseLength, double baseWidth, double pyramidHeight){

       

       //First, calculate the base area of the pyramid

       //store the result in a double variable

       double baseArea = baseLength * baseWidth;

       

       //Then, calculate the volume of the pyramid

       //using the base area and the base width

       double volume = 1 / 3.0 * baseArea * pyramidHeight;

       

       //return the volume

      return volume;

   }

}

Output:

Volume for 1.0, 1.0, 1.0 is: 0.3333333333333333

Explanation:

The code above contains comments explaining the important lines of the code. The output of the code has also been provided above.

The parts of the code that are worth noting are:

(i) The return type of the method pyramidVolume should be a double since calculations are done using double values. i.e the method header should be written as

public static double pyramidVolume(){

}

(ii) The method requires three(3) parameters of type double: baseLength, baseWidth and pyramidHeight. These should be included in the method. Therefore, the complete header definition should be:

public static double pyramidVolume(double baseLength, double baseWidth, double pyramidHeight){

}

(iii) The formula for calculating the volume of the pyramid should be:

volume = 1 / 3.0 * baseArea * baseWidth;

Rather than;

volume = 1 / 3 * baseArea * baseWidth;

This is because integer division yields integer result. If 1 / 3 is evaluated, the result will be 0 since the decimal part will be truncated thereby making the result of the volume = 1 / 3 * baseArea * baseWidth will be 0.

Therefore, the work around for that should be to write 1 / 3.0 or 1.0 / 3.0 or 1.0 / 3.

(iv) After the calculation, the result of volume should be returned by the method. This will enable a proper call by the main method for execution.

what the rule of pattern 1 4 9 16 25​

Answers

(1)² = 1

(2)² = 4

(3)² = 9

(4)² = 16

(5)² = 25

Claire needs to make an SRS document. Help her identify the given section and subsection.

The ___ subsection mentions the list of factors that may influence the requirements specified in the SRS. This subsection is part of the section named ___

Blank 1:
A. Scope
B. Purpose
C. Assumptions

Blank 2:
A. Introduction
B. General Description
C. Specific Requirements

Answers

Answer:

C and B in that order

Explanation:

give one word • pressure exerted by a stationary liquid _______. • force in a direction perpendicular to a given surface area _______. • a pair of forces whose resultant is zero _______.​

Answers

Answer:

1. Hydrostatic pressure.

2. Pressure.

3. Equilibrium forces.

Explanation:

1. Hydrostatic pressure: pressure exerted by a stationary liquid. It is simply the pressure in a liquid such as water at a specific depth.

Mathematically, hydrostatic pressure is given by the formula;

[tex] H.P = rho * g * d [/tex]

Where:

H.P is the hydrostatic pressure of a liquid.rho represents the density of a liquid.g is the acceleration due to gravity.d is the depth (height) of a liquid.

2. Pressure: it is the force in a direction perpendicular to a given surface area. Thus, it's typically measured in Newton per meters (N/m²).

Mathematically, pressure is given by the formula;

[tex] Pressure = \frac {Force}{area} [/tex]

3. Equilibrium forces: a pair of forces whose resultant is zero. It is also referred to as balanced forces because the resultant of all the pair of forces acting on a body or system is at equilibrium (balanced).

HEEELLPPPPP, ILL GIVE THE BRAIN THING

Which entry by the user will cause the program to halt with an error statement? # Get a guess from the user and update the number of guesses. guess = input("Guess an integer from 1 to 10:") guess = int(guess)
7
-1
5.6
36​

Answers

Can you explain more please??!

Identify the correct statements about run-time errors. Choose all that apply.
Run-time errors occur when the program is running.
Run-time errors cause the program to halt.
Run-time errors cause the program to restart.
Run-time errors occur when a numeric value is expected but a text value is entered.
Run-time errors occur when a text value is expected but a numeric value is entered.
Run-time errors cause the program to run fast.
DONE

Answers

Explanation:

1. Run-time errors occur when the program is running.

2. Run-time errors cause the program to halt.

4. Run-time errors occur when a numeric value is expected but a text value is entered.

5. Run-time errors occur when a text value is expected but a numeric value is entered.

What component can you use to open windows?
-A servomotor
-An LED
-A buzzer
-An ambient light sensor

Answers

Answer:

A servomotor.

Explanation:

Because you can only open the window with the force given by the servo motor.I am not sure tho

applications of kinematics in computer engineering​

Answers

Answer:

There is a wide application of kinematics; it is also used in astrophysics. In mechanical engineering, robotics, and biomechanics, it is used to describe the motion of the system of the joint parts.

name the cell range selected in the given worksheet?
plzzz helppppp​

Answers

Answer:

B2:E6,,,,,,,,,,,,,,,,

When running on its 11.4 V battery, a laptop computer uses 8.3 W. The computer can run on battery power for 7.5 h before the battery is depleted. Part A What is the current delivered by the battery to the computer

Answers

Answer:

The correct answer is "0.73 A".

Explanation:

Given that:

Power,

P = 8.3 W

Voltage,

ΔV = 11.4 V

The current will be:

⇒  [tex]I = \frac{P}{\Delta V}[/tex]

On substituting the values, we get

⇒     [tex]=\frac{8.3}{11.4}[/tex]

⇒     [tex]=0.73 \ A[/tex]

Synapse is not working and is crashing every time you attach it. What should you do?

1. Contact a staff
2. Wait for it to be fixed
3. delete it
4. Spam dm everyone

Answers

Contact a staff memeber

Static methods can be called directly from the name of the class that contains the method.

a. True
b. False

Answers

the answer is false.
I would say false because thats not the person that owns it its just in their class

Your answer
Antivirus is a ........ software.​

Answers

Answer: True

Explanation:

Software refers to the programs and other instructions which enable us to be able to execute tasks on a computer. Everything you see when you turn on the computer is software from the operating system to the browsers that you use.

An antivirus is no different. It is basically a software on the computer that is able to monitor the activities of other software to ensure that the computer does not get infected by malicious software.

Please help it’s timed

Answers

Answer:

2nd, third, and the 5th one

Explanation:

Question # 6
Fill in the Blank
Complete the following sentence.
The World Wide Web launched to the public in

Answers

CERN released the code for the World Wide Web to the public on April 30, 1993. Subsequently, CERN made a release available under an open licence, which was a more reliable strategy for maximising its reach.

Which year was India's introduction to the World Wide Web?

The first time the world wide web was ever made accessible to the general public on the Internet was on August 6, 1991. It has changed so little in 26 years from how it was then.

In 1994, what was invented?

The IBM Simon, the first smartphone in history, goes on sale on August 16. The first PlayStation game console is made available in Japan on December 3. The first high-brightness blue LED is created, and the researchers are awarded the 2014 Nobel Prize for their discovery.

To know more about World Wide Web visit:-

https://brainly.com/question/20341337

#SPJ1

The following are three possible logon scenarios. Explain why option (c) below is preferable in terms of system security. a. Welcome to XYZ computing Enter username: jones Invalid username Enter username: b. Welcome to XYZ computing Enter username: smith Enter password: password Invalid access Enter username: c. Enter username: smith Enter password: password Invalid access Enter username: smith Enter password: FpQr56 Welcome to XYZ computing

Answers

Answer:

because the password being used is of high quality

Explanation:

Option C is the most preferable in terms of system security because the password being used is of high quality. Meaning that it contains lower case and capital case letters as well as numbers. It is also a random mix of all three and is not a common word or name. The length of the password is normal but could be longer for better safety. These things make it very difficult and time-consuming for a software program to guess the password, and nearly impossible for an individual to guess.

Let L be the set of exactly those strings over the alphabet \Sigma = {a, b, c, g}, that satisfy all of the following properties: the length of the string is equal to 5n+3, for some natural number n greater or equal than 0; all of the first (leftmost) 2n symbols are elements of the set {b, c, g}; all of the last (rightmost) 3n symbols are elements of the set {a, b}; the symbols at position 2n+1, 2n+2, and 2n+3 (from the left, i.e., after the first 2n symbols but before the last 3n symbols) are elements of the set {c, g}; Write a complete formal definition of a context free grammar that generates L. If such a context free grammar does not exist, state that the context free grammar does not exist, and prove it.

Answers

Answer:

S -> LSR

S -> M

M -> YYY

Y -> c | g

L -> XX

X -> b | c | g

R -> ZZZ

Z -> a | b

Explanation:

This is a long time ago, but I think this does what you want.

Start symbol S expands to LSR and allows you to grow L and R on either side as much as you want. Ultimately S must be replaced by M. Then you have a pattern like LLLLLMRRRRR.

We can then further break down L into 2 times b, c or g, and similar for M and R.

Other Questions
I NEED HELP ASAP"Find the measure of each angle in the following diagram" Help needed ASAP, I will mark your answer as brainliest. Please help A.S.A.P its due today! QUESTION AND DIAGRAM IN PICTUREBRAINLIEST TO CORRECT ANSWER How much energy is released when 6.0 g of water is condensed from watervapor?A. 6.0 g x 1 mol/18.02 g x 4.186 kJ/molB. 6.0 g 1 mol/18.02 g 6.03 kJ/molO C. 6.0 g x 1 mol/18.02 g * (-285.83 kJ/mol)O D. 6.0 g x 1 mol/18.02 g x 40.65 kJ/mol Uzupenij rozwizanie podanego rwnania.a) 4x+ 5 = 2x-3 1-5b) 4x - 8 = 6 3x | +84x+5-5=2x-3-54x 8+8 = 6 - 3x + 84x=-3x+1+3x4x = 2x -_- 2x4x - 2x =4x + 3x =1:2 Find the area of the shaded sector Where is point a on the number line? 146. The ATP/CP Pathway is best for which of the following activities? A. Running a marathon B. 100m sprint C. 30 minutes steady state cardio D. - Tabata workout Karen uses 9.3 pints of blue paint and white paint to paint her bedroom walls. 3/5 of this amount is blue paint, and the rest is white paint. How many pints of white paint did she use to paint her bedroom walls? analyzing the setting of a science fiction essay Identify the choice that best answers the question.Which of the following would be most likely to be written with a conversational tone?OA. a humorous essay about attending a concertB.an obituary for a famous and respected actoraC. a news report about the election of a young mayordDan analysis of a documentary about space exploration Make a Small paragraph about a family having a great relationship What happens when energy interacts with carbon dioxide or methane to cause an increase in gases on Earth Surface? Which two words or phrases in this excerpt from Kurt Vonneguts report on the HURRY 20 POINTS AND BRAINLIEST.Read the passage.Men being, as has been said, by nature, all free, equal, and independent, no one can be put out of this estate, and subjected to the political power of another."Second Treatise of Government,John Locke, 1690How does the passage relate to Enlightenment ideas about government?Governments cannot take away natural rights.Powerful people cannot lose their natural rights.People are naturally free, equal, and independent.Governments give some rights and take away others. Who uses the apothecary system?O ApothecariesO Sports Medicine ClinicsO PharmaciesO Medical LabsO None of these A long, straight wire lies along the zz-axis and carries a 3.90-AA current in the z z-direction. Find the magnetic field (magnitude and direction) produced at the following points by a 0.600 mmmm segment of the wire centered at the origin. the area of a circle is 64 ft2. what is the circumference in feet? Express your answer in terms of What is the graph of y = x2 + 6x + 13 ?What does the graph look like