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
fiasKO [112]
3 years ago
13

Write a function named “createPurchaseOrder” that accepts the quantity (integer), the cost per item(double), and the description

(string). It will return a newly created PurchaseOrderobject holding that information if they are valid: quantity and cost per item cannot be negative and the description can not be empty or blank(s). When it is invalid, it will return NULL to indicate that it cannot create such PurchaseOrderobject.
Computers and Technology
1 answer:
Leona [35]3 years ago
4 0
#include
Program: using namespace std;
string createPurchaseOrder0;
int main(
{
cout<return 0;
}
string createPurchaseOrder(
{
int qty;
double costPerltem;
string description,info="":
cout<<"Enter Quantity:
cin>>qty;
cout<<"Enter cost per item: "
cin>>costPerltem;
cout<<"Enter Description: "
cin>>description;
if(qty<0 I| costPerltem<0
Idescription.compare(''"')==0)
cout<<'InThe entered data is invalid!":
info="":
else
"
cout<<"'InThe entered data is valid!":
info=info+"'(nQuantity: "+to_string (qty) +" In";
info=info+"Cost per item:
"†to_string (costPerltem)+"In";
info=info+"Description: "description+" In";
return info;

Output:
You might be interested in
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
Sladkaya [172]

Answer:

The program written in Java is given in the explanation section

Explanation:

public class num9 {

//Defining the method CountCharacters()

   public static int CountCharacters(char userChar, String userString){

       int c = userString.length();

       int count=0;

       for(int i=0; i<c; i++){

           if(userString.charAt(i)==userChar){

               count++;

           }

       }

       return count;

   }

//Main method begins here

   public static void main(String[] args) {

   char n ='n';

   String word = "Monday";

//Calling the method CountCharacters()

       System.out.println(CountCharacters(n,word));

   }

}

4 0
3 years ago
A _________ is the broadcast of various types of media over the web.
Dmitry [639]
News Report.
I hope this helps! :)
4 0
4 years ago
Read 2 more answers
During the first six months of his job, Enrique's boss gave him weekly feedback about his performance. What component of effecti
Nat2105 [25]
Being direct I think because Enrique’s boss is being direct about his work and making sure he does his job. The other options don’t sound right
8 0
3 years ago
After several configuration changes are made to a router, the copy running-configuration startup-configuration command is issued
adoni [48]

Answer: NVRAM(Non-volatile random-access memory)

Explanation:Non-volatile random-access memory(NVRAM) is the memory that has a non-volatile nature.It is used for retaining of the data even when the system gets switched off .

This memory uses the power source from the CMOS battery for executing the functions. It is designed by using the pin configurations containing 24 pin in DIP(Dual inline package). So the situation mentioned in the question of storing the changes will appear in the NVRAM.

4 0
4 years ago
What two devices in a computer should be considered "black boxes," and should never be opened due to risks involving charged cap
NNADVOKAT [17]

The two devices in a computer that should be considered "black boxes," and should never be opened due to risks involving charged capacitors are MONITOR and POWER SUPPLY.

Explanation:

  • Physical contact or close proximity to the open power supply caused a discharge from the capacitor that resulted in an electric shock. Capacitors can discharge current even when not energized because they hold a charge for some time after the power is turned off.
  • To do harm to your body, the voltage across the capacitor's terminals must be high enough to cause a harmful effect on you. There are no hard rules for at what voltage things become harmful, but a common 'rule of thumb' is that DC up to 48 Volt is considered low voltage. So a capacitor charged to a voltage below 48 V is fairly safe.
  • A charged capacitor can be very dangerous, so it's important that you avoid coming into contact with the terminals at all times.
3 0
3 years ago
Other questions:
  • What is the correct method to use Dreamweaver to find broken links and orphaned files?
    15·1 answer
  • Use ___________ positioning to configure the location of an element to remain the same and to not move even when the web page is
    6·2 answers
  • Extended ACLs can filter traffic based on _____. (Points : 3) protocol type
    8·1 answer
  • Cookies Are Us runs a series of 100 cookie stores across the Midwestern United States and central Canada. At the end of each day
    13·1 answer
  • What are three key characteristics of an OS process?
    11·1 answer
  • Why are Quick Parts useful in an Outlook message?
    10·2 answers
  • True/false questions are useful in determining a student’s ability to____information
    8·1 answer
  • X = 9 % 2<br><br> if (x == 1):<br>   print ("ONE")<br> else:<br>   print ("TWO")
    5·2 answers
  • Does putting a glue stick on your touchpad make it stop working pls help
    10·1 answer
  • What is a good theme statement for the short Pixar film "bao"?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!