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
Lemur [1.5K]
3 years ago
11

Write an algorithm to sum to values

Computers and Technology
1 answer:
Elis [28]3 years ago
5 0

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

You might be interested in
What is bugtraq?
beks73 [17]

Answer:

The answer would be (C) An industry mailing list provided by Symantec that reports new vulnerabilities as they are discovered.

I hope this helped!

3 0
3 years ago
Read 2 more answers
What is the default zoom percentage in Word?<br><br> 50%<br> 100%<br> 150%<br> 200%
Hunter-Best [27]

Answer:

its 100%

Explanation:

5 0
3 years ago
Read 2 more answers
The goal for me is that I need to identify the objects needed for the UNO card game and the actions that those objects perform,
Alik [6]

Answer:

Explanation:

//Java program

class UnoCard{

  private String color;

  private int value;

 

  public UnoCard(String color , int val) {

      this.color = color;

      value = val;

  }

  public String getColor() {

      return color;

  }

  //set the color of the card

  public void setColor(String color ) {

      this.color = color;

  }

  //get the value of the card

  public int getValue() {

      return value;

  }

  //set the value of the card

  public void setValue(int val) {

      value = val;

  }

  //return true if card has same value or

  //same color as the card

  //return false otherwise

  public boolean isMatch(UnoCard card) {

      return (this.value==card.value)||(this.color==card.color);

  }

}

public class Card {

  public static void main(String args[]) {

      UnoCard card1 = new UnoCard("Red",10);

      UnoCard card2 = new UnoCard("Green",10);

      UnoCard card3 = new UnoCard("Blue",15);

     

      if(card1.isMatch(card2))System.out.println("Match");

      else System.out.println("No Match");

     

      if(card2.isMatch(card3))System.out.println("Match");

      else System.out.println("No Match");

  }

}

6 0
4 years ago
Isabella plans to work as a freelance DTP publisher. Her DTP setup is a non-Apple Macintosh platform. She has several options fo
nadya68 [22]
A lot of printers would work. I recommend HP printers because that is what I use and they work great for me.

One of my favorite ones is the HP Deskjet 2543. You can print in black and color, you can copy, and you can scan. Connect it to the computer with a USB port and wait for the computer to recognize it, then you are ready to go. It also supports wireless printing. You can print something from your phone without any cables. How cool is that?
7 0
4 years ago
Choose the 3 correct statements for the code below.
Nookie1986 [14]

Answer:

True

False

True

False

True

Explanation:

So I'll go through each statement and explain why or why not they're correct.

An object of the ActivationLayer class has a name attribute. So because ActivationLayer is inheriting the BaseLayer and it's calling super().__int__("Activation") it's going to call the BaseLayer.__init__ thus setting a name attribute equal to "Activation" for any ActivationLayer object that is initalized. So this is true

An object of the BaseLayer class has a size attribute. While it is true that FC layer is inheriting from BaseLayer and it has a size attribute, this does nothing to change the BaseLayer class. So any object initialized to a BaseLayer object will only have the instance attribute "self.name". So this is false

print(FCLayer(42)) prints FullyConnectedLayer. So whenever you print an object, it tries to convert the object to a string using the __str__ magic method, but if that wasn't defined it then tries the __repr__ method, which the FCLayer class technically doesn't define, but it inherits it from the BaseLayer class. And since whenever you define an FCLayer object it calls super().__init__ with "FullyConnected", which will then be assigned to the instance variable self.name,  it will print "FullyConnectedLayer". So this is true

When creating an object of the ActivationLayer class, the size argument must be given. This is true, because the size is a parameter of the __init__ method of ActivationLayer, it is not an optional parameter, and is something that must be passed otherwise an error will be raised. So this is false

When creating an object of the BaseLayer class, the name argument must be given. This is not true, because name is a default argument. This means if you do not pass an argument for name, then name will equal an empty string

4 0
2 years ago
Other questions:
  • What formula most likely exists in D18?
    5·1 answer
  • Technician A says a 2:1 gear ratio doubles the amount of torque. Technician B says a 2:1 gear ratio reduces the speed by half. W
    8·1 answer
  • You approach a railroad crossing with a cross buck sign that has no light or gates . What should you do ?
    5·1 answer
  • What is wrong with each of the following?
    6·1 answer
  • why are the ads you might see on tv between 8am and 10am usually not the same ads you would see between 8pm and 10pm?
    12·1 answer
  • "Using the printf method, print the values of the integer variables bottles and cans so that the output looks like this: Bottles
    12·1 answer
  • Helpppppppp!!!!!!!! Some program menus are the same in every program you open. Under the File menu, all of the following are the
    15·2 answers
  • I need the answer ASAP. I’ll mark brainliest if right
    5·1 answer
  • Element primer a partir del qual es generarà l'energia central solar fotovoltaica
    9·1 answer
  • Match the cell reference to its definition,
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!