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
hodyreva [135]
3 years ago
11

Write a method called printGrid that accepts two integers representing a number of rows and columns and prints a grid of integer

s from 1 to (rows * columns) in column major order. For example, the call printGrid(4, 6); should produce the following output: 1 5 9 13 17 212 6 10 14 18 223 7 11 15 19 234 8 12 16 20 24

Computers and Technology
1 answer:
Gnoma [55]3 years ago
3 0

Answer:

See attached pictures.

Explanation:

See attached picture for code with explanation.

You might be interested in
My brainly is no hello friend , i need you can you help me, please okay
Pachacha [2.7K]

Answer:

I'll try to help you!

what do you need?

Explanation:

I hope you have an amazing day!

✧◝(⁰▿⁰)◜✧

8 0
2 years ago
Read 2 more answers
Write a short program using Python that will:
Alexxx [7]

Answer:

// program in Python to check perfect number

#function to find number is perfect or not

def is_Perfect_Number(n):

   #total variable

   tot = 1

   i = 2

   #sum of all divisor of number

   while i*i<=n:

       if n%i==0:

           tot = tot + i + n/i

       if tot == n and n != 1:

           return 1

       i = i+1  

   return 0

#read until user enter a perfect number

while True:

   #read integer

   num = int(input("Input an integer: "))

   #call the function

   if(is_Perfect_Number(num)):

       print(num,"is perfect number")

       #if perfect number break

       break

   else:

       print(num,"is not a perfect number")

       #ask again

   print("try again.")

Explanation:

Read number from user and then call the function is_Perfect_Number() with  parameter "num".This will find the sum of all divisor of number.If sum is  equal to number then it will return 1 else return 0.If the number is not  perfect then it will again ask to enter a number until user enter a perfect  number.

Output:

Input an integer: 24

24 is not a perfect number                                                                                                

try again.                                                                                                                

Input an integer: 28                                                                                                      

28 is perfect number

6 0
3 years ago
Write a fragment of code that will test whether an integer variable score contains a valid test score. Valid test scores are in
Klio2033 [76]

Answer:

Following are the code in the C Programming Language.

//set integer datatype variable

int score;

//check condition is the score is in the range of 0 to 100

if(score > 0 && score < 100){

//print if condition is true

printf("Valid test scores");

}else{

//otherwise print the following string.

printf("test scores are Invalid");

}

Explanation:

<u>Following are the description of the code.</u>

In the following code that is written in the C Programming Language.

  • Set an integer data type variable i.e., score.
  • Then, set the if conditional statement to check the condition is the variable "score" is greater than 0 and less the 100.
  • If the following statement is true then print "Valid test scores".
  • Otherwise, it print "test scores are Invalid".
5 0
3 years ago
1. Type a statement that reads a user-entered integer into variable numUsers. Assume scnr already exists.
ASHA 777 [7]

Answer:

Question 1:

int numUsers = scnr.nextInt();

Question 2:

public class OutputExample {

public static void main (String [] args) {

int numCars = 99;

Scannerscnr=new Scanner(System.in);

numCars=scnr.nextInt();

System.out.println("There are "+numCars+" cars");

return;

}

}

Question 3:

import java.util.Scanner;

public class Errors {

public static void main(String [] args) {

int userNum = 5;

System.out.println ("Predictions are hard. ");

System.out.print("Especially ");

System.out.print("about the future.");

System.out.println("Num is: "+userNum);

return;

}

}

Explanation:

In Question 1, the statement int numUsers = scnr.nextInt();  reads a new integer value from the keyboard and assigns it to the variable numUsers.

In question 2, Concatenation is used to format the print output.

In question 3, care is taken to fix each of the syntax errors (missing double quotes, semi-colon, concatenation)

3 0
3 years ago
In early Oklahoma, __________ tribes were most nomadic. A. hunting B. farming C. semi-sedentary D. agricultural Please select th
denpristay [2]

Answer:

A

Explanation:

They needed to follow the food/buffalo

5 0
2 years ago
Other questions:
  • What is the output of this code? import java.util.HashSet; class A { public static void main(String[ ] args) { HashSet set = new
    15·1 answer
  • The equipment that processes data in order to create information is called the _______.
    8·2 answers
  • How can supply and demand for different careers affect job stability and income?
    6·1 answer
  • Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorith
    8·1 answer
  • Technology offers a variety of rich opportunities available to teachers and students. According to Inan and Lowther (2010), ther
    6·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    13·1 answer
  • Instructions
    12·1 answer
  • What do Business Analysis workers do? Check all that apply.
    15·2 answers
  • What is keylogging attack?
    13·2 answers
  • You saved a file on drive C go your computer. You want to find and open the file. Which of the following programs will you use t
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!