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
emmainna [20.7K]
3 years ago
7

C++ Question (if and while loops)

Computers and Technology
1 answer:
IceJOKER [234]3 years ago
8 0
Your while statement is in error

<span>while (wage = 0) assigns 0 to wage.

What you want is to compare wage to 0, ie.:

while (wage == 0).

However, comparing double's to some value is very bad practice due to rounding errors. Much safer is to always have a < or > in there:

while (wage < 0.0001)

If you confuse assignment (=) and comparison (==) often, and you don't have a compiler to warn you for this, you can adopt the coding style to put the constant first:

while(0 == x)</span>
You might be interested in
Which of the following types of memory is used to load programs and transfer files during your work sessions? A. D-ROM B. RAM C.
hammer [34]
I believe the answer is B-Ram <span />
4 0
3 years ago
Read 2 more answers
Complete the divisible_by(list1, int1) function below. As input, it takes a list of integers list1 and an integer int1. It shoul
damaskus [11]

Answer:

The function is as follows:

def divisible_by(listi, n):

   mylist = []

   for i in listi:

       if i%n == 0:

           mylist.append(i)

   return mylist

   pass

Explanation:

This defines the function

def divisible_by(listi, n):

This creates an empty list

   mylist = []

This iterates through the list

   for i in listi:

This checks if the elements of the list is divisible by n

       if i%n == 0:

If yes, the number is appended to the list

           mylist.append(i)

This returns the list

   return mylist

   pass

5 0
3 years ago
What did you predict will happen? Check all that apply. The lioness will attack Thisbe. Thisbe will stay hidden in the cave to a
sesenic [268]

Hi,


Everything applies. It is impossible to predict based on the current data. All scenarios are possible with equal possibility.


Hope this helps.

r3t40

5 0
3 years ago
Read 2 more answers
Describing the technologies used in diffrent generation of computer​
kupik [55]

Windows 98, Windows XP, Windows vista, Windows 7, Windows 8 y Windows 10.

8 0
2 years ago
Suppose that you have created a program with only the following variables.int age = 34;int weight = 180;double height = 5.9;Supp
Yuri [45]

Answer:

a. calculate(age, weight); // This is legal

b. calculate(age, height); // This is legal

c. calculate(weight, height); // This is legal

d. calculate(height, age); // This is not legal

e. calculate(45.5, 120); // This is not legal

f. calculate(12, 120.2); // This is legal

g. calculate(age, size); // This is not legal

h. calculate(2, 3); // This is legal

i. calculate(age); // This is not legal

j. calculate(weight, weight); // This is legal

Explanation:

a. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

b. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

c. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

d. This is not legal because even though two parameters were passed. The first one should be int but double was supplied and double cannot be downgraded to int. There is a possible lossy conversion from double to int.

e. This is not legal because even though two parameters were passed. The first one should be int but double was supplied and double cannot be downgraded to int. There is a possible lossy conversion from double to int.

f. This is legal because the method requires two parameter and two are passed. The method requires integer and double. The passed parameter are integer and double.

g. This is not legal because even though two parameters were passed. The first one should be int but the second parameter is not defined before been passed to the calculate method.

h. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

i. This is not legal because only one parameter was passed instead of two.

j. This is legal because the argument passed are two in numbers and they are integers but the integer for the second parameter can be cast to double.

3 0
3 years ago
Other questions:
  • What are words with the root gest?
    15·1 answer
  • A ____ is text and graphics that print at the bottom of every page.
    12·1 answer
  • At your job, you often have to address letters to the customer support manager, Tyson Kajewski. The problem is that you are cons
    9·1 answer
  • To determine what to study, one should first
    8·1 answer
  • Write java code that displays all the objects in a stack in the order in which they were pushed onto it. after all the objects a
    5·1 answer
  • Why is stranded rather than solid cable used for patch cables? Why is it critical not to score the jacket too deeply when stripp
    12·1 answer
  • Which statement describes Augmented Reality (AR) technology?
    12·1 answer
  • Landing pages in a foreign language should never be rated fully meets?
    14·1 answer
  • any one that owns a chrome book there is a new update there is new features and there is a game on settings where you see what y
    15·2 answers
  • Please name the OOP term that allows children classes to have methods with the same names as methods in their parents.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!