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
Xelga [282]
2 years ago
9

write a C++ program that ask the user for the number of cookies eaten and display the calorie consumption

Computers and Technology
1 answer:
Artyom0805 [142]2 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   int cookies;

   cin >> cookies;

   cout << "The calorie consumption is: " << cookies * 142 << endl;

   return 0;

}

Explanation:

First line: include basic library of C++(input and output).

using namespace std;

Says to compiler we are using std.

int main() Main function

int cookies, cookies variable, of int type

cin >> cookies

get the number of the cookies from user

cout Print the text and calories(one cookie have 142 calories)

Have a nice day ;)

You might be interested in
All who are interested in forex trading and bitcoin mining follow me for account management to all who are busy with work so i c
masya89 [10]

I am very interested but too young just 10

8 0
3 years ago
What is the purpose of memory address?​
IceJOKER [234]

Answer:

A memory address is a unique identifier used by a device or CPU for data tracking.

5 0
2 years ago
Read 2 more answers
1. Implement a method factorial(int n), that takes a number (int) and returns its factorial. Factorial of an integer is the prod
marysya [2.9K]

Answer:

import java.io.*;

import java.util.*;

public class Main

{

public static int factorial(int n){

if (n == 0)

return 1;    

else

return(n * factorial(n-1)); //recursively calling factorial function

}

public static void fibbonaci(int n)

{

if(n>0)

{

c=a+b; //next term in series

a=b;

b=c;

System.out.print(" "+c);    

fibbonaci(n-1); //recursively calling fibbonaci function

}

}

static int a=0,b=1,c;

  public static void main(String[] args) {

  int list_num,fact;

      List<Integer> num=Arrays.asList(1,3,5,7,9); //arraylist with 1,3,5,7,9

      for(Integer i:num) //for-each loop

      {    

      a=0;

      b=1;

      list_num=i.intValue();

      System.out.println("Fibbonaci series for "+list_num);

      System.out.print(a+" "+b);

      fibbonaci(list_num-2); //calling fibbonaci for values in list

      fact=factorial(list_num); //calling factorial for values in list

      System.out.println();

      System.out.println("Factorial for "+list_num+" is "+fact);

      System.out.println();

     

      }

  }

}

6 0
3 years ago
What term is used to describe a list of security policies that is associated with an object?
Artemon [7]

Answer:

An Access control list (ACL) is used to describe a list of security policies that is associated with an object

5 0
3 years ago
Have a great day!
valina [46]

Answer:

thank you so much!

Explanation:

you seem like such a nice person! have a great weekend!

5 0
2 years ago
Read 2 more answers
Other questions:
  • Refer to the exhibit. the gigabit interfaces on both routers have been configured with subinterface numbers that match the vlan
    11·1 answer
  • Energy is defined as stored energy
    13·2 answers
  • Can you structure this code in if-statements?
    15·1 answer
  • Directory servers from different vendors are synchronized through ________.
    9·1 answer
  • im in honors comupter science and one of my questions is evaluate 18% 7 does anyone know how to answer that
    6·1 answer
  • Robert's employer has agreed to pay half the tuition for Robert to complete his college degree. This benefit is known as what?
    7·2 answers
  • A ______ is a group of slides designed and formatted for a specific purpose. These include themes as well as content.
    8·1 answer
  • You manage a network that uses switches. In the lobby of your building, there are three RJ45 ports connected to a switch. You wa
    5·1 answer
  • Select all the correct answers.
    13·2 answers
  • What are the difference among the whole note, half note and quarter note ? (this is music)
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!