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
Ne4ueva [31]
2 years ago
8

How could this code be simplified?

Computers and Technology
1 answer:
nikklg [1K]2 years ago
4 0

The code to be simplified is not indicated but I will give you a general guide to simplifying Java codes.

<h3>How do you simplify Java Code?</h3>

  1. At the top, declare and initialize your variables. Late declaration disrupts readability.
  2. Create specific functions that are modular. It is inefficient to have functions that attempt to "do it all".
  3. Make it a practice to name the function to correspond to the task.
  4. All duplications must be removed and rectified
  5. Having comments provide a fantastic way to summarize the purpose of a code.
  6. Do not overuse recursion. Doing this makes it difficult to understand at a glance.
  7. If possible, do not use global variables. The local variable takes precedence over the global variable in JavaScript.

Learn more about Java code at;
brainly.com/question/18554491
#SPJ1

You might be interested in
List pros and cons of HCI technology​
Verdich [7]
A pro of HCI technology is that its user friendly and a con about it is that you have to teach the user what to do or guide them!
8 0
3 years ago
Read 2 more answers
Which of the following statements is true about biometrices as an authentication method
matrenka [14]

Answer:

what are the statements?

Explanation:

7 0
3 years ago
Assume you are given three variables, revenue, expenses, and profit, all of type Money (a structured type with two int fields, d
Andre45 [30]

Answer:

if(revenue.cents - expenses.cents < 0){

profit.dollars = revenue.dollars - expenses.dollars - 1;

profit.cents = 1 - revenue.cents - expenses.cents;

}

else{

profit.dollars = revenue.dollars - expenses.dollars;

profit.cents = revenue.cents - expenses.cents;

}

Explanation:

We know that profit is given as: revenue - expenses from the question.

From the given expression above;

if(revenue.cents - expenses.cents < 0)

then profit.dollar will be revenue.dollars - expenses.dollars - 1; the 1 is to be carry over to the cent part. And the profit.cent will be 1 - revenue.cents - expenses.cents;

else the profit.dollars and the profit.cent is computed directly without needing to carry over:

profit.dollars = revenue.dollars - expenses.dollars;

profit.cents = revenue.cents - expenses.cents;

7 0
3 years ago
Microsoft Publisher - Assignment #1
Allisa [31]

Answer:1

Explanation:

6 0
3 years ago
What is the advantage of using CSS?
zhannawk [14.2K]
Your answer would be B.) "It streamlines the HTML document."
8 0
3 years ago
Read 2 more answers
Other questions:
  • Enzo formed a study group for an upcoming geography test. To start off each session, they go over past notes and look at maps. T
    14·1 answer
  • Consider the clipping of a line segment in two dimensions against a rectangular clipping window. Show that you require only the
    10·1 answer
  • A(n) _____ can replace many applications with one unified set of programs, making the system easier to use and more effective.
    8·1 answer
  • What is the critical path?
    15·1 answer
  • L00000000000000000000000000000000000000000000000000000000l they b00ty tickled
    6·2 answers
  • Which one my guys I need help
    7·1 answer
  • )
    11·1 answer
  • Why is dark supereffective against ghost?
    5·2 answers
  • When a company sends you recommendations of what to buy you know that :
    12·1 answer
  • 3. What of the following is the main components of computer system?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!