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
Verizon [17]
3 years ago
5

At the moment i am tackling the cs50x projects and i need a little bit of help with problem set 1, the 'greedy algorithm'. I am

unsure why my program doesn't work. Can you please help me troubleshoot? My program is attached: The answer to the attached terminal pic is supposed to be 4.

Computers and Technology
1 answer:
mars1129 [50]3 years ago
6 0
That you have to multiply first and then divide
You might be interested in
Write an expression that computes the integer average of the int variables exam1 and exam2 (both declared and assigned values).
Minchanka [31]

Answer:

#include <iostream>

using namespace std;

int main()

{

   int exam1 = 70;

   int exam2 = 85;

   int examAverage;

   examAverage = (exam1+exam2)/2;

   cout <<"The Average of Exam1 and Exam2 is: "<<examAverage<<endl;

   return 0;

}

Explanation:

Using the C++, we declare the three variables all of type

exam1

exam2 and

examAverage

We assign initial values of 70 and 85 to exam1 and exam2 respectively

7 0
3 years ago
___________ is some danger that can exploit a vulnerability.
andreyandreev [35.5K]

<u>Threat </u>is some danger that can exploit a vulnerability.

<h3>What is Threat?</h3>

Threat  is seen as Anything that can be able to take advantage of a vulnerability, intentionally as well as  accidentally, and take or damage, the  asset of a person.

Note that a threat is that which a person or firm is protect against and Vulnerability is seen as Weaknesses.

Therefore, <u>Threat </u>is some danger that can exploit a vulnerability.

Learn more about vulnerability from

brainly.com/question/25633298

#SPJ1

8 0
2 years ago
Which of the following feature are parts of Toyota’s safety system?
ElenaW [278]
What are the options?
7 0
3 years ago
Factoring of integers. Write a python program that asks the user for an integer and then prints out all its factors. For example
Oduvanchick [21]

num = int(input("Enter a number: "))

i = 2

while num > 1:

   if num % i == 0:

       num = num / i

       print(i, end=" ")

       i = 2

   i += 1

I hope this helps!

8 0
3 years ago
3.1.1 What type of goods are car radio and remote control.​
Nuetrik [128]

Answer:

Radio Controlled cars .

4 0
3 years ago
Other questions:
  • Assume that
    7·1 answer
  • Briefly explain the cooling mechanism implemented in a fanless laptop
    15·1 answer
  • Carlos own a hardware store.He currently is not using any software to track what he has in the store. .In one to two sentences,
    10·1 answer
  • Please Do Solve it guys...
    6·1 answer
  • What is the traditional cognitive perspective ofHCL?
    12·1 answer
  • The Internet began when a large company wanted to sell products online.
    11·2 answers
  • Choose all that apply.
    11·1 answer
  • Explain the basic operations of a computer system​
    6·1 answer
  • A(n) ____________________ key is a key that is not reused, but rather is only used once, thus improving security by reducing the
    5·1 answer
  • 1.Microsoft Word is a/an ........​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!