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
lara31 [8.8K]
1 year ago
12

write (define) a public static method named countup, that takes one int argument and returns no value. you can safely assume tha

t the argument will always be a positive integer. when this method is called, it should print a count from 1 up to (and including) the argument value.
Computers and Technology
1 answer:
tester [92]1 year ago
7 0

Using the knowledge of computational language in python it is possible to write a code that write (define) a public static method named countup, that takes one int argument and returns no value.

<h3>Writting the code:</h3>

<em>public class </em><em>Main</em>

<em>{</em>

<em>public static void main(</em><em>String</em><em>[] args) {</em>

<em>// testing the method </em><em>countDown </em><em>with values 5, 6, 1</em>

<em>countDown(5);</em>

<em>System.out.println();</em>

<em>countDown(6);</em>

<em>System.out.println();</em>

<em>countDown(2);</em>

<em>System.out.println();</em>

<em>}</em>

<em />

<em>public static void </em><em>countDown</em><em>(int num)</em>

<em>{</em>

<em>for (int i=1 ; i<=num ; i++) // for </em><em>loop </em><em>iterates from 1 to num</em>

<em>{</em>

<em>System.out.print(i+","); // prints num followed by comma ,</em>

<em>}</em>

<em>}</em>

<em>}</em>

See more about JAVA at brainly.com/question/12975450

#SPJ1

You might be interested in
How does a computer work
ivann1987 [24]

Answer:

computer works on electricity

Explanation:

6 0
2 years ago
Consider a company that needs to sort an array of structures of type Customer by balance, with the largest balance first. Here i
8090 [49]

Answer:

#include <iostream>

#include <string>

#include <cstring>

#include <cstdlib>

using namespace std;

struct Person

{

string name;

int age;

};

int main()

{

struct Person data[10];

struct Person *pData[10],*temp;

string names[] = {"a","b","c","g","z","l","p","q","r","w"};

int num[] = {4,6,34,8,13,90,33,22,18,23};

for(int i=0;i<9;i++)

{

data[i].name = names[i];

data[i].age = num[i];

pData[i] = &data[i];

}

for(int i=0;i<9;i++)

{

for(int j=i+1;j<9;j++)

{

if(pData[i]->name.compare(pData[j]->name)>0)

{

temp = pData[i];

pData[i] = pData[j];

pData[j] = temp;

}

}

}

for(int i=0;i<9;i++)

{

cout<<pData[i]->name<<" "<<pData[i]->age<<endl;

}

}

Explanation:

The line #include <iostream> initializes the program.

This program created an array of only 10 structures, Customer data. Also defined an auxiliary array Customer *pData.

The program uses these parameters to sorts the array of pointers so that when you go through pData in increasing order of index k, the entries pData[k] point to Customer objects in decreasing order by balance, meaning that pdata[0] now points to the customer with the highest balance, and pData[9] points to the customer with the smallest balance.

4 0
3 years ago
If you created a variable called name, what data type would that value be? Group of answer choices a float a string a Boolean an
Semenov [28]

I think its an integer

8 0
2 years ago
Read 2 more answers
When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memor
miv72 [106K]

Answer:

recognition

Explanation:

<h2><u>Fill in the blanks</u></h2>

When you take a multiple-choice test, you are relying on <u>recognition</u> , a means of retrieving information out of your long-term memory storage system that helps you choose the correct answer.

4 0
3 years ago
Who programmed the UNIVAC computer and literally "debugged" the first computer?
marysya [2.9K]

Grace Hopper is the first
7 0
3 years ago
Read 2 more answers
Other questions:
  • An Open Authorization (OAuth) access token would have a _____ that tells what the third party app has access to
    5·1 answer
  • Can a computer evaluate an expression to something between true and false? Can you write an expression to deal with a "maybe" an
    13·2 answers
  • How is informatics affecting banking and financial institutions?
    13·1 answer
  • This information is generally included on a fax cover sheet.
    15·1 answer
  • When I comes to saving money, what is good rule of thumb
    5·1 answer
  • A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county s
    11·1 answer
  • Interruption attacks are also called ___ attacks:
    8·1 answer
  • A command, such as a button or keyboard shortcut, that performs a specific task is known as a
    9·2 answers
  • 2ND LAST QUESTION
    13·1 answer
  • What are Database administrators? <br> Thank you :)
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!