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
larisa [96]
3 years ago
8

Write an Algorithm to print only numbers from 10 to n times using iteration structure

Computers and Technology
1 answer:
spayn [35]3 years ago
6 0

Answer:

Contact me if you need additional comment/explanation:

1. Human-language declarations for x and n:

let x be the number of iterations that have been examined at a given time. let n be the multiple iterations upon which your code will execute.

2. What we're doing:

The first code block (Block A) uses only one variable, x (defined above), and uses 5 (an integer) rather than the variable n (defined above).

The second code block (Block B) uses both of the variables (x and n) that are defined above. The integer, 5, will be replaced by the variable, n. So, Block B literally performs an action at each nth iteration.

Our goal is to do something every Xth iteration and every 5th/nth iteration. We are going through 100 iterations.

m. Easy-to-understand code:

Block A, minimal variables:

Explanation:

PLZ MARK ME BRAINLYIST

You might be interested in
Any part of the computer that you plug into the CPU like a phone, tablet, headphones etc. are called
gtnhenbr [62]

Answer:

usb

Explanation:

8 0
3 years ago
Create a view named Top10PaidInvoices that returns three columns for each vendor: VendorName, LastInvoice (the most recent invoi
maksim [4K]

Answer:

See Explaination

Explanation:

SELECT TOP 10 VendorName AS Name, MAX(InvoiceDate) AS LastInvoice, SUM(InvoiceTotal) AS SumOfInvoices

FROM dbo.Vendors V JOIN dbo.Invoices I

ON V.VendorID = I.VendorID

WHERE PaymentDate IS NOT NULL

GROUP BY VendorName

ORDER BY SumOFInvoices desc;

5 0
3 years ago
A person clicks on an ad of a fitness club in a blog on nutrition. The person conducts a search on yoga and moves to another web
Sloan [31]

Answer: the answer is B.

hope this help

3 0
3 years ago
Write a method that computes the sum of the digits in an integer. Use the following method header: public static int sumDigits(l
kifflom [539]

Answer:

The java program for the given scenario is shown below.

import java.util.*;

import java.lang.*;

public class Test

{

   //variables to hold the number, digits and sum of the digits

   //variable to hold number is assigned any random value

   static long num=123;

   static int sum=0;

   static int digit;

   static int s;

   //method to add digits of a number

   public static int sumDigits(long n)

   { do

       {

           digit=(int) (n%10);

           sum=sum+digit;

           n=n/10;

       }while(n>0);

       return sum;

   }

public static void main(String[] args) {

    s = sumDigits(num);

 System.out.println("The sum of the digits of "+num+ " is "+s);  }

}

OUTPUT

The sum of the digits of 123 is 6

Explanation:

1. The variables to hold the number is declared as long and initialized.

2. The variables to store the digits of the number and the sum of the digits are declared as integer. The variable, sum, is initialized to 0.

3. The method, sumDigits(), is defined which takes a long parameter and returns an integer value. The method takes the number as a parameter and returns the sum of its digits.

4. Inside method, sumDigits(), inside the do-while loop, the sum of the digits of the parameter is computed.

5. Inside main(), the method, sumDigits(), is called. The integer value returned by this method is stored in another integer variable, s.

6. The sum of the digits is then displayed to the console.

7. All the variables are declared outside main() and at the class level and hence declared static. The method, sumDigits(), is also declared static since it is to be called inside main().

8. In java, the whole code is written inside a class since java is a purely object-oriented language.

9. In this program, object of the class is not created since only a single class is involved having main() method.

10. The program can be tested for any value of the variable, num.

11. The file is saved as Test.java, where Test is the name of the class having main() method.

7 0
3 years ago
Question
Serhud [2]
Could be second or all of above
8 0
3 years ago
Other questions:
  • Explain how buyers and sellers factor into setting the stock price for a company’s shares.
    13·1 answer
  • Here are the codes for producer and consumer problems.
    10·1 answer
  • A server that provides data transfer and storage space at remote locations is called a
    7·1 answer
  • 6.
    14·2 answers
  • (3 points) Write a program to process two large chunks of data (e.g., a large 3D array and an array of self-defined structures w
    11·2 answers
  • Which two actions allow the System Administrator to limit Chatter access during roll-out to a subset of Salesforce users?
    9·1 answer
  • A lack of financial literacy can cause you to lose your
    10·1 answer
  • Describe at least two other companies that are direct or indirect competitors to your company. Explain how you will differentiat
    15·1 answer
  • Write a program that reads in 10 numbers and displays the number of distinct numbers and the distinct numbers in their input ord
    14·1 answer
  • Explain how you can apply the computer in your field of study​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!