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]
4 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]4 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
TLE(ICT)-10
DerKrebs [107]

Answer:

Android

iOS

Explanation:

Operating systems refers to the embedded software program upon which a machine ( computer or smartphone) is programmed to work. Applications or programs which machines would run must be compatible with that which is designed for the operating system. Operating systems handles and controls process and file management, input and output among others.

The Android and iOS operating system are the two most popular operating systems used on smartphones. In terms of ownership, iOS is developed by Apple and it is not open source (closed source). It has a simple and very less customizable interface. Smart products such as iPhones, iPads run on iOS operating system.

Android on the other hand is runned by googl and is more open source, with a much more customizable interface, android garners more

popularity in the smartphone ecosystem. Most major smartphone devices run on Android such as Samsung, Sony and so on.

Other operating systems may include windows which are very less popular.

3 0
3 years ago
What variation of a dictionary attack involves a dictionary attack combined with a brute force attack, and will slightly alter d
allochka39001 [22]

Answer:

hybrid

Explanation:

A hybrid attack is a blend of both a dictionary attack method as well as brute force attack. This means that while a dictionary attack method would include a wordlist of passwords, the brute-force attack would be applied to each possible password in that list.

7 0
3 years ago
The length, height, and width of a cube are 10, 7, and 5 cm respectively. Write a program that calculates the volume, perimeter,
RideAnS [48]

Answer:

// code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables

   int length=10,height=7,width=5;

   // find the volume of

   int vol=length*height*width;

   // find the surface area

   int sa=2*(length*width+length*height+height*width);

   // find the perimeter

   int peri=4*(length+width+height);

   // print the volume

   cout<<"Volume is: "<<vol<<" cm^3."<<endl;

   // print the surface area

   cout<<"Surface area is: "<<sa<<" cm^2."<<endl;

   // print the perimeter

   cout<<"Perimeter is: "<<peri<<" cm."<<endl;

return 0;

}

Explanation:

Declare and initialize length=10, width=5 and height=7.calculate volume by multiply length, width and height and assign to variable "vol".Then find the surface area as 2*(length*width+length*height+height*width) and assign it to variable "sa".Then find the perimeter as 4*(length+width+height) and assign to variable "peri". Print the volume, perimeter and surface area.

Output:

Volume is: 350 cm^3.

Surface area is: 310 cm^2.

Perimeter is: 88 cm.

8 0
4 years ago
I Need an experienced or inspired game developer to answer these questions
Ivahew [28]

Answer:

WHAT ARE u trying to work for dm me on discord RealFazeRug#4361 and ill help ya m8 because im good with tech lol

Explanation:

5 0
4 years ago
The this reference . a) can be used implicitly b) must be used implicitly c) must not be used implicitly d) must not be used 25)
Gnom [1K]

Answer:

yeet

Explanation:

because computers

6 0
3 years ago
Other questions:
  • Jane works in the sales department of a service company. She has impressive interpersonal skills and always turns up for work on
    11·2 answers
  • Drag the tiles to the correct boxes to complete the pairs. Match the tools that you can use while solving a problem with their c
    6·2 answers
  • The piston ring isn't a completely solid ring; instead, it's usually split at one point. This split or gap in the ring is called
    7·2 answers
  • Unlike the String class where you must pass a message to an object (instance) of the class, as in x.length( ), in order to use t
    5·1 answer
  • Describe some ways that you personally use information technologies differently than you did just a few years ago
    11·1 answer
  • Which scenario could be represented by the given graph?
    14·1 answer
  • Rob used Track Changes to suggest changes in Jack's document. Jack agrees with some edits and disagrees with others. What should
    14·1 answer
  • What are three key characteristics of an OS process?
    11·1 answer
  • HELP ASAP!!!!<br> I don't know the code to these images and I need that code now.
    12·1 answer
  • What is the depth of the following tree?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!