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
alexgriva [62]
3 years ago
10

Convert each of the following for loops into an equivalent while loop. (You might need to rename some variables for the code to

compile, since all four parts a-d are in the same scope.)
// a.

System.out.println("a.");
int max = 5;
for (int n = 1; n <= max; n++) {

System.out.println(n);

}

System.out.println();

// b.

System.out.println("b.");

int total = 25;

for (int number = 1; number <= (total / 2); number++) {

total = total - number;

System.out.println(total + " " + number);

}

System.out.println();

// c.

System.out.println("c.");

for (int i = 1; i <= 2; i++) {

for (int j = 1; j <= 3; j++) {

for (int k = 1; k <= 4; k++) {

System.out.print("*");

}

System.out.print("!");

}

System.out.println();

}

System.out.println();

// d.

System.out.println("d.");

int number = 4;

for (int count = 1; count <= number; count++) {

System.out.println(number);

number = number / 2;

}
Computers and Technology
1 answer:
MAVERICK [17]3 years ago
5 0

Answer:

~CaptnCoderYankee

Don't forget to award brainlyest if I got it right!

Download txt
You might be interested in
You have been asked to implement a data integrity program to protect data files that need to be electronically downloaded by the
Katyanochek1 [597]

Answer:

SHA-1 is used in this case.

Explanation:

7 0
3 years ago
Write an algorithm to calculate the simple interest using the formula​
sesenic [268]

Answer:

step 1:- start

step 2:-read principal amount, rate and time

step 3:- calculate interest using formula sI=((amount*rate*time)/100)

step 4:- print simple interest

step 5:- //CPP program to find compound interest for. //given values

3 0
2 years ago
You are testing a site and realize that when you click a graphic link you see an outline but no picture. What is wrong with the
deff fn [24]

Pictures not loading on websites Chrome – Many users reported that pictures aren't loading on websites in Chrome. To fix the problem, be sure to check your Chrome settings and disable your antivirus. Images won't load in Chrome – Sometimes this issue can appear if JavaScript is disabled in your browser.

Explanation:

Speaking of image problems, users reported the following issues:

  • Broken image icon Firefox, Internet Explorer – According to users, you might be able to experience this issue in other browsers including Firefox and Internet Explorer. If the problem appears in other browsers, the issue is related to your system or to your network configuration.
  • Pictures not loading on websites Chrome – Many users reported that pictures aren’t loading on websites in Chrome. To fix the problem, be sure to check your Chrome settings and disable your antivirus.
  • Images won’t load in Chrome – Sometimes this issue can appear if JavaScript is disabled in your browser. If that’s the case, simply enable JavaScript and the problem will be resolved.
  • Chrome showing broken images – In some cases, extensions can lead to this problem, and if you noticed that your images are missing, simply disable or uninstall your extensions and check if that solves the problem.
  • You can remove an image from the preview by clicking the thumbnail below Available images. Edit Descriptions: If you've added multiple images, click the description below each image in the preview to edit it.
  • Icon in the top-right corner of the window. Select Internet Options. In the Internet Options window, click the Advanced tab. In the Settings under Multimedia, make sure there is a check in the Show Pictures check box.
7 0
2 years ago
Mary needs to choose the menu in order to place the text in a desired fashion around the image.
mixas84 [53]
Full features



Option C


hope this one help
6 0
3 years ago
Question 4(10pt): sum of the max value found in each row Write a function maxSum that takes two parameters; a 2D integer array w
mario62 [17]

Answer:

Following is the program in c++ language  

#include <iostream> // header file

using namespace std; // namespace

int maxSum(int ar[][10],int r) // function definition of  maxsum

{

  int s=0; // varaible declaration

  for(int k=0;k<r;k++)// iterating the loop

  {

      int maximum=ar[k][0]; //finding the maximum value

      for(int k2=0;k2<10;k2++)// iterating the loop

      {

          if(maximum<ar[k][k2]) // check the condition

          {

            maximum=ar[k][k2];   // storing the value in the maximum variable

          }

           }

       s=s+maximum;//adding maximum value to the sum

  }

  return s; // return the sum

}

int main() // main function

{

  int ar[][10]={{5,2,8,-8,9,9,8,-5,-1,-5},{4,1,8,0,10,7,6,1,8,-5}}; // initilaized array

  cout<<"sum of maximum value:";

  int t=maxSum(ar,2); // function calling

  cout<<t; // display the maximum value

}

Output:

sum of maximum value:19

Explanation:

Following are the description of Program  

  • The main method declared and initialized an array ar with the column value 10.
  • After that call the method maxsum .The control will move to the function definition of maxsum.
  • In the function header of maxisum there are two value i.e array "ar" and "r".
  • In this function definition, we adding the maximum value to the sum and return the variable "s".
  • In the main function, we print the value.
5 0
3 years ago
Other questions:
  • Give one advantage and two disadvantages of using a wireless network
    8·1 answer
  • The ________ phase is a technical blueprint for a whole system which captures all aspects of how the system's components will fu
    9·1 answer
  • Hat are three machines or devices that depend on gravity to work?
    5·1 answer
  • You are given two processors P1 and P2 that execute the same instruction set but have different architectures. The instructions
    9·1 answer
  • Quiz
    6·2 answers
  • HELP PLS TIME LIMIT HERE
    11·1 answer
  • Is a pocket watch consider a computer
    15·1 answer
  • PLSSSSS HELPP!! Tropical rainforests are home to many kinds of birds, including parrots, toucans and eagles. Each different spec
    9·2 answers
  • Any one know??please let me know
    15·2 answers
  • Write a pseudocode to calculate the volume of a cylinder​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!