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
timofeeve [1]
3 years ago
11

Assignment 4 evens and odds

Computers and Technology
1 answer:
Viefleur [7K]3 years ago
4 0

I've added my own code in a picture below. I didnt really notice any error, which would cause problems in your code. The main issues I had with your code is purely readability. You should start using the format function along with the curly brackets to concatenate variables into strings. You should also start doing even += 1 instead of even = even + 1. I also tweaked your range function. Simply putting n makes it much easier to read and understand.

You might be interested in
What is the answer to 4.9 Code Practice: Question 2
bixtya [17]

Answer:

sum = 0

for i in range(20, 100, 10):

sum = sum + i

Print(sum)

Explanation:

7 0
3 years ago
How long will it take Lola to travel from Paris to nice?
Alisiya [41]

the answer is 5,000 hours.

I recommend you post these kind of questions in the mathematics section

4 0
4 years ago
_____ is a predefined format used for text the can include multiple font formatting features
seraphim [82]
The correct answer is



style
8 0
3 years ago
If you are parked on an incline with a manual transmission vehicle and your vehicle is facing downhill, you should put your vehi
emmainna [20.7K]
If you're parked between cars, it's preferable to just leave it in neutral: this way, if somebody bumps you, it doesn't harm the transmission. Just make sure you've got the handbrake firmly set.

<span>If on a hill, 1st gear if facing uphill; reverse if facing downhill. Just make sure to set the parking brake </span>before<span> releasing the clutch, so that the weight of the car is on the brake first; the gear is there only as a backup should the brake fail.</span>
4 0
3 years ago
Consider the following recursive method. public static string recur(int val) { string dig = "" + (val % 3); if (val / 3 &gt; 0)
Oksana_A [137]

The recursive method recur executes itself from within

When the statement System.out.println(recur(32)); is executed, the string value "2101" is printed

<h3>How to determine the output of the statement?</h3>

The flow of the program is as follows:

  • The method keeps updating the string variable dig with the remainder of the val variable divided by 3
  • When the remainder is less than or equal to 0, the method is exited

So, when 32 is divided by 3.

The remainders are 2, 1, 0 and 1

So, the output of the statement is "2101"

Read about java methods at:

brainly.com/question/19271625

5 0
2 years ago
Other questions:
  • What is a locally stored url, or the address of a file or internet page saved as a shortcut?
    10·1 answer
  • The difference between an AutoCorrect entry and a building block is that the building block feature makes corrections automatica
    6·1 answer
  • What is the prediction in technology for the future?
    6·1 answer
  • What means can a worm use to access remote systems to propagate?
    7·1 answer
  • how do i create an advanced search using the search criteria in the range K2:S3 and the inventory data where the results will be
    8·1 answer
  • . Why did the designers of the Synchronous Digital Hierarchy choose unusual values for data rates instead of the exact powers of
    11·1 answer
  • Describe how a black and white image could be represented in binary
    11·2 answers
  • Select the correct text in the passage.
    12·1 answer
  • How to write a C++ program that lets the user guess if a randomly generated integer is even or odd then the computer lets them k
    6·1 answer
  • a good way to repeatedly perform an operation is to write the statements for the task once and then place the statements in a lo
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!