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
vovangra [49]
3 years ago
12

Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.

Computers and Technology
1 answer:
LUCKY_DIMON [66]3 years ago
5 0

Answer:

Given

The above lines of code

Required

Rearrange.

The code is re-arrange d as follows;.

#include<iostream>

int main()

{

int userNum;

scanf("%d", &userNum);

if (userNum > 0)

{

printf("Positive.\n");

}

else

{

printf("Non-positive, converting to 1.\n");

userNum = 1;

printf("Final: %d\n", userNum);

}

return 0;

}

When rearranging lines of codes. one has to be mindful of the programming language, the syntax of the language and control structures in the code;

One should take note of the variable declarations and usage

See attachment for .cpp file

Download cpp
You might be interested in
What is the other name of iterative staatement ​
Mademuasel [1]

Answer:

An loop statement

Explanation:

An iteration statement, loop, repeatedly executes a statement, know as a loop body,until the controlling expression is false

8 0
3 years ago
Consider the following method: static void nPrint(String a, int n) { System.out.println(a.charAt(n)); } What potential error cou
Juliette [100K]
<span>Briefly explain why it is necessary to critique a scientific argument before it is accepted.
</span>
4 0
3 years ago
The Domain Name Service is what translates human-readable domain names into IP addresses that computers and routers understandA.
Mars2501 [29]

Answer:

True

Explanation:

A Domain Name Service comprises of computer servers that carries a database of public IP addresses and their related human-readable domain names/hostnames, it receives query as hostnames and helps to translates those human-readable domain names/hostnames into IP addresses that computers and routers understand.

5 0
3 years ago
Match the definition
Katen [24]

Answer:

¿???????????? SORRY..........

8 0
2 years ago
The ________ maps the software architecture created in design to a physical system architecture that executes it. (Points : 3) a
VARVARA [1.3K]

Answer:Deployment diagram

Explanation: Deployment diagram is the diagram that is used for displaying the hardware parts upon which the software architecture works.The main purpose of the diagram is showing the function and operations taking place through the deployment of the software system with the hardware.

These diagrams are made up of the nodes , interface, artifacts and other components. Other given options are incorrect because architectural diagram is for designing of the architecture of a system,sequence diagram is used for the sequential order display of system components and  state chart diagram is the diagram that shows the status of the parts of the operating system.

Therefore, the correct option is deployment diagram.

8 0
3 years ago
Other questions:
  • Which of these is a preferred method for
    14·2 answers
  • You use worksheets to perform calculations. How do you perform these calculations?
    15·2 answers
  • Which task might be suitable for moving into a separate function so you can re-use it from multiple places in your code?
    11·1 answer
  • In which format is information stored on a hard drive?
    5·1 answer
  • James, a technician, needs to format a new drive on a workstation. He will need to configure read attributes to specific local f
    5·1 answer
  • Constructors have the same name as the ____.1. data members2. member methods3. class4. package
    5·1 answer
  • If your vehicle leaves the pavement for any reason, remember to take your foot off the gas pedal, hold the wheel firmly, and____
    8·2 answers
  • If, when asked for a date of birth, the user enters a future date, this error should be caught by a ________ check.
    8·1 answer
  • which of the following can be represented by a sequence of bits. 1. An integer 2. An alphanumeric character 3. A machine languag
    12·1 answer
  • Someone please help ASAP will brainlist
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!