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
telo118 [61]
3 years ago
7

Using C++, complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2

, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by "seconds". End with a newline. Example output for ounces = 7:42 seconds1 #include 2 using namespace std; 34 void PrintPopcornTime(int bagOunces) { 56 /* Your solution goes here */ 78 } 9 int main() { 10 int userOunces; cin >> userOunces; 11 PrintPopcornTime12 13 return 0; 14 }
Computers and Technology
1 answer:
victus00 [196]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

void PrintPopcornTime(int bagOunces) {

   if(bagOunces < 2)

       cout << "Too small" << endl;

   else if(bagOunces > 10)

       cout << "Too large" << endl;

   else

       cout << 6 * bagOunces <<" seconds" << endl;

}

int main()

{

   int userOunces;

   cin >> userOunces;

   PrintPopcornTime(userOunces);

   return 0;

}

Explanation:

Inside the function PrintPopcornTime, check the parameter bagOunces using if structure. Depending on the value of bagOunces, print the required information.

Inside the main, ask the user for the userOunces. Call the PrintPopcornTime function with the userOunces.

You might be interested in
I'm using assembly language. This is my assignment. I kinda confused about how to write code for this assignment. Can anyone exp
Brut [27]

Answer:

oid changeCase (char char_array[], int array_size ) {

__asm{

   mov eax, char_array;    

   mov edi, 0;

readArray:

   cmp edi, array_size;

   jge exit;

   mov ebx, edi;          

   shl ebx, 2;

   mov cl, [eax + ebx];    

check:

   //working on it

   cmp cl, 0x41;      

   jl next_indx;

   cmp cl, 0x7A;      

   jg next_indx;

   cmp cl, 'a';

   jl convert_down;

   jge convert_up;

convert_down:

   or cl, 0x20;        //make it lowercase

   jmp write;

convert_up:

   and cl, 0x20;      

   jmp write;

write:

   mov byte ptr [eax + ebx], cl    

next_indx:

   inc edi;

exit:

   cmp edi, array_size;

   jl readArray;

mov char_array, eax;

}

}

Explanation:

  • Move char_array to eax as it is base image .
  • Use ebx as offset .
  • Use ecx as the storage register .
  • check if cl is <= than ASCII value 65 (A) .
6 0
3 years ago
_____ is a web application server that provides the ability to connect web servers to multiple data sources.
o-na [289]
ColdFusion/JRun is a web application server that provides the ability to connect web servers to multiple data sources.ColdFusion/JRun  is an application server developed by Adobe, that is based on Sun Microsystems' Java 2 Platform, Enterprise Edition (J2EE). The other options are eliminated because: Ms Access is <span>Database Management System , FoxPro is database development system and dBase is also data management system.</span>
7 0
3 years ago
What is the shortcut to select all text?
abruzzese [7]
Highlight everything with your curser.
7 0
3 years ago
Read 2 more answers
Which of the following statements about professional codes of conduct is true?
Diano4ka-milaya [45]

Answer:

They define how professionals should make decisions about their professional behavior.

Explanation:

3 0
3 years ago
The parts of a memo are _____.
Alex
The correct answer would be D
4 0
3 years ago
Read 2 more answers
Other questions:
  • According to Mintzberg's classification of managerial roles, the role of a(n) ______ is to transmit information received from ou
    7·1 answer
  • SecOps focuses on integrating the need for the development team to provide iterative and rapid improvements to system functional
    11·1 answer
  • Which of the following best describes the 7x7 PowerPoint rule
    8·1 answer
  • (Help please I don't know what to choose because it's both text and email but I can only pick one. HELP!!!!!!!!!!)
    6·2 answers
  • What is the model for 2017 Ford Mustang v6
    15·1 answer
  • Photoshop files are generally small in size. True or false
    13·1 answer
  • Please hurry!
    15·2 answers
  • What are the functions of super computer?<br> ​
    7·2 answers
  • How do you save a document in a format so that any reader can view it?
    5·1 answer
  • Give a brief explanation about the internet.plsssss
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!