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
steposvetlana [31]
4 years ago
6

Consider the following code segment. for (int a = 0; a < 10; a++) { for (int b = 10; b > a; b--) { System.out.print("#");

} } How many "#" symbols are printed as a result of executing the code segment?
Computers and Technology
1 answer:
Ket [755]4 years ago
6 0

Answer:

55

Explanation:

Given the codes as below:

  1.        for (int a = 0; a < 10; a++)
  2.        {
  3.            for (int b = 10; b > a; b--)
  4.            {
  5.                System.out.print("#");
  6.            }
  7.        }

There are two layer loops in the code. The outer loop (Line 1) will run for 10 iterations by traversing through a = 0 to a=9. However, the inner loop  (Line 3) will run for 10 + 9 +  8 + 7 +...+ 1 = 55 iterations.

Since the print statement is within the inner loop (Line 5) and therefore the number of printed "#" symbols is dependent on the number of iterations of the inner loop. There will be 55 "#" symbols printed.

You might be interested in
What does %d, , %c, %s mean and what's their difference?
Leviafan [203]
Not sure in what environment your asking for, but in C programming, %d is an integer (basically a number), %c is a character, that is a single alphanumeric character, where as %s is a series of alphanumeric characters, in programming %s is actually just an array of characters (so multiple %c), but don't worry about that to much. 

Examples in c. 

int number = 1;
char character = "c"; (numbers (integers) can be characters)
char string[5] = "abcd"; ([5] implies 5 characters, here there are 4, that is because an invisible character exists known as a "null terminator" (\0).
6 0
3 years ago
Read 2 more answers
Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y =
Gre4nikov [31]

The brute strength method determines if each x and y value satisfies both conditions. To do this, we must iterate through each result in the specified range and insert them into both models.

<h3>What are Elegant mathematical technique?</h3>

ALGORITHM :

1. Take the values of all coefficients and SET flag = FALSE

2. Run a FOR loop for x in range (-10, 11). 11 won't be included.

2a. Inside the first FOR, start the y FOR loop in range(-10,11). 11 won't be included

2b. Inside the y FOR loop, check IF for a particular value of x and y both the equations satisfied.

2c. If yes, set flag TRUE and print values of x and y.

2d. ELSE the flag stays FALSE.

END FOR Y

END FOR X

3. Check if flag = FALSE, then print NO SOLUTION

PYTHON CODE :

a=int(input()) #taking input for each coefficient

b=int(input())

c= int(input())

a1= int(input())

b1= int(input())

c1= int(input())

flag = False

for x in range(-10,11): #checking for all values of x in range -10 to 10

for y in range(-10,11): #checking for all values of x in range -10 to 10

if (a  x + b  y – c == 0) and (a1*x + b1*y - c1 == 0) : #checking if the x and y values satisfy the equation

flag = True #setting the flag if solution is found

print('Solution : x = {-10, 10}, y = {-10, 10}'.format(x,y)) #if they satisfy print x & y

if flag = False : #if flag stays false, that means there is no solution

print('No solution')

OUTPUT : The output is given below.

More about the Elegant mathematical technique link is given below.

brainly.com/question/27934739

#SPJ1

4 0
2 years ago
What are entity-relationship diagrams and how are they used? What symbol is used for a relationship? What is an associative enti
castortr0y [4]

Answer:

The definition including its given problem is outlined in the following segment on the clarification.

Explanation:

  • Entity-relationship (ER) diagram describes how mechanical stored procedures are constructed and demonstrate the overarching representation of the situation. It also describes the connections between some of the entities of the framework and even the comparison with standard measurements.
  • For something like an individual relationship structure, the normal representation of connections seems to be a diamond. Associative institutions have several to many partnerships to communicate with. It's indeed the verb throughout a diamond-shaped form that holds two organizations around each other. This verb is in fact an entity on its own, therefore it must be termed an associative entity.
  • An illustration of such might be if a participant were to register for a class. Multiple individuals will be registered for several courses, and there have been many to several relationships; thus, the associative object will indeed register.
4 0
3 years ago
Which of the following is NOT a computer peripheral?
Marianna [84]

Answer:CPU stands for the central processing unit. CPU is not a peripheral device.

Explanation:

CPU stands for the central processing unit. CPU is not a peripheral device.

7 0
1 year ago
Write a class named Book that has fields to hold the following data: Title Author Year published ISBN number In the Book class,
Hatshy [7]

Answer:

public class Book {

   private String title;

   private String author;

   private int yearPublished;

   private long ISBN;

   //The Constructor for all the feilds

   public Book(String title, String author, int yearPublished, long ISBN) {

       this.title = title;

       this.author = author;

       this.yearPublished = yearPublished;

       this.ISBN = ISBN;

   }

   //Mutator methods (set) to Set values of all the fields

   public void setTitle(String title) {

       this.title = title;

   }

   public void setAuthor(String author) {

       this.author = author;

   }

   public void setYearPublished(int yearPublished) {

       this.yearPublished = yearPublished;

   }

   public void setISBN(long ISBN) {

       this.ISBN = ISBN;

   }

   //Accessor Methods (getters) for all the feilds

   public String getTitle() {

       return title;

   }

   public String getAuthor() {

       return author;

   }

   public int getYearPublished() {

       return yearPublished;

   }

   public long getISBN() {

       return ISBN;

   }

}

// The Demo Class creating three instances of this class

class BookDemo{

   public static void main(String[] args) {

       Book bookOne = new Book("The Lion and the Princess","David A.",2000,12334556);

       Book bookTwo = new Book ("Me and You", "Jane G.", 2001, 4567342);

       Book bookThree = new Book("together forever", "Baneely H.",2019,34666);

   }

}

Explanation:

  • Please pay attention to the comments provided in the solution
  • Using Java Programming Language
  • The class Book is created with the required fields
  • The constructor is created to initialize the values of the fields
  • Getter methods are created
  • Setter Methods are Created
  • A demo Class BookDemo that creates three objects of the Book class is the created (This can be in the same file as the Book class but cannot start with the keyword public or in a separate file with the keyword public class BookDemo)
  • Inside BookDemo class, three instances of the Book class are created and initialized.
3 0
3 years ago
Other questions:
  • A good place to get hints about how to answer a response question could be a. Your teacher c. Both of these b. The rest of the t
    13·2 answers
  • An organization that operates a small web-based photo backup business is evaluating single points of failure. The organization h
    7·1 answer
  • How would you determine if your earned credits would transfer to a regionally accredited school?
    14·2 answers
  • What hex value is the standard indicator for jpeg graphics files?​?
    6·1 answer
  • You should structure the first before you search for a relevant picture.
    8·1 answer
  • What does a converter do? A. It converts one technological system into another. B. It converts one type of electrical signal int
    10·2 answers
  • Two things every professional PowerPoint presentation should have
    8·1 answer
  • Why can it be helpful to perform mathematical calculations using programming? Choose the best answer.
    11·1 answer
  • Where do animators work?
    6·1 answer
  • The term for an operator that may not evaluate one of its subexpressions is
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!