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
alekssr [168]
4 years ago
12

*/ What's wrong with this program? /* public MyProgram { public static void main(String[] args); } int a, b, c \\ Three integers

a = 3 b = 4 c = a + b System.out.println('The value of c is' + C); {
Computers and Technology
1 answer:
gulaghasi [49]4 years ago
6 0

Answer:

A lot is wrong with the program given in the question. See the corrected version below:

<em>public class ANot {</em>

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

<em>        int a, b, c;</em>

<em>    //Three integers</em>

<em>    a = 3; b = 4; c = a + b;</em>

<em>        System.out.println("The value of c is " + c);</em>

<em>    }</em>

<em>}</em>

Explanation:

Errors:

1. The main method had a semi colon after it. This is wrong

2. An open brace was supposed to follow the main method

3. The declaration of the variables was supposed to end with a semi colon

4. the correct comment style is // and not \\

5. Initialization of variables was supposed to end with semi colons

6. The output statement had C and not c which is the declared and initialized variable..Java is strictly typed

7. Open and closing braces for the class and method wrongly placed

You might be interested in
Write the definition of a void function that takes as input two integer values, say n and m. The function returns the sum and av
hodyreva [135]

Answer:

void mn(int m, int n){

   int sum = 0;

int count = 0;

   if(m<n){

       for(int i = m;i<=n;i++){

           sum+=i;

       }

   }

   else{

       for(int i = n;i<=m;i++){

           sum+=i;

       }

   }

count = abs(m - n)+1;

   cout<<"Sum: "<<sum<<endl;

   cout<<"Average: "<<(float)sum/count;

}

Explanation:

This line defines the method

void mn(int m, int n){

This initializes sum and count to 0

   int sum = 0;

int count = 0;

This checks if m is less than n

   if(m<n){

This iterates from m to n and calculates the sum of numbers between this interval

<em>   for(int i = m;i<=n;i++){</em>

<em>            sum+=i;</em>

<em>        }</em>

<em>    }</em>

If otherwise,

   else{

This iterates from n to m and calculates the sum of numbers between this interval

<em>        for(int i = n;i<=m;i++){</em>

<em>            sum+=i;</em>

<em>        }</em>

<em>    }</em>

This calculates the range from m to n using absolute function

count = abs(m - n)+1;

This prints the calculated sum

   cout<<"Sum: "<<sum<<endl;

This calculates and prints the average

   cout<<"Average: "<<(float)sum/count;

}

<em>See attachment for complete program that includes the main (in c++)</em>

Download cpp
7 0
3 years ago
Which of the following tasks is least effective at preventing a computer virus?
Ksivusya [100]

Answer:

all of the above mentioned

5 0
3 years ago
Read 2 more answers
Why OSI is called open system?
MAXImum [283]

Answer: OSI system is called Open System Interconnection because It provides the collection of protocols for the connection of different system to connect with  any dependence on any other system or network.

Explanation: Open system interconnection establishes a connection between the different system for the communication purpose using several protocols and software standards .It has no dependency or any network or other system to do the functioning and works using the seven layers of the OSI architecture.Thus, that is why OSI system known as open system.

7 0
4 years ago
A _____ utilizes standard business software, such as Microsoft Word or Microsoft Excel, which has been configured in a specific
Vera_Pavlovna [14]

Answer:

User application

Explanation:

A user application is a program that is created by using a standard software that is adjusted to the user's needs that can't be fulfilled by an existing system. According to this, the answer is that a user application utilizes standard business software, such as Microsoft Word or Microsoft Excel, which has been configured in a specific manner to enhance user productivity.

7 0
3 years ago
1. What cause cable problems? How can these problems be solved?
lukranit [14]

Explanation:

Ageing.

Wrong selection or application.

Mechanical failures.

Corrosion of sheath.

Moisture in the insulation.

Heating of cable.

Fire and lightning surges.

Electrical puncture.

This is the only thing I know that causes cable problems, sorry if it couldn't help you!

4 0
3 years ago
Other questions:
  • Shirley was unsure about what career to go into. Her high school counselor suggested a personal assessment to point out Shirley’
    12·2 answers
  • matlab Write a function that iteratively appends random 1's and 0's to an array to form a binary number. The function returns th
    9·1 answer
  • Because so many newspapers now have online versions of their publications, many observers feel that "circulation" is an insuffic
    11·1 answer
  • Please Help!!!<br> I keep getting this answer wrong
    10·1 answer
  • A measuring cylinder is used to measure the volume of an irregular<br>solid object.​
    5·1 answer
  • Chapter 12 Reading Question 19 The most distinguishing characteristic of geographical information systems is: Every record or di
    5·1 answer
  • The Publisher-Subscriber design pattern is used to create __________________ communication between software objects and is used
    13·1 answer
  • There are main type of memory
    7·1 answer
  • Which of these is a problem that a computer CANNOT solve? *
    15·2 answers
  • 1. List three tabs that make up the Ribbon
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!