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]
2 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]2 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 JAVA PROGRAM TO PRINT THE PATTERN<br> 13579<br> 2468<br> 357<br> 46<br> 5
Inessa05 [86]

Answer:

import java.util.Scanner;

import java.lang.*;

class Main

{

  public static void main(String args[])

  {

     int n;

     //For capturing the value of n

     Scanner scanner = new Scanner(System.in);

     System.out.println("Enter the value of n:");

     //The entered value is stored in the var n

     n = scanner.nextInt();

     int k=1;

     printnum(n,k);  

  }

  public static void printnum(int n,int k)

  {

       if(n%2==0)

       {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

       }

       else

        {

       for(int i=k;i<=n-1;i=i+2)

            {

                System.out.print(i);

            }    

        System.out.println("");

        }

      n--;

      if(n<=1)

      {

         System.exit(0);

      }

      else

      {

          printnum(n,k+1);

      }

   }

}

Explanation:

The program is self explanatory.

4 0
3 years ago
Edhesive 6.8 lesson practice answers
FromTheMoon [43]

Answer:

1.) 25 ; 15 ; 15

2.) 50 ; 15 ; 50

Explanation:

In the first function written :

The variable val was initially decaled or assigned a value of 25 and that was what was printed first.

However, after the example function was written, the val variable was finally assiagned a value of 15 within the function. However, it was also declared that the global variable takes uonthe val value. Hence, the val variable initially assigned a value, of 25 changes to 15 globally.

For the second code :

From the top:

Val was assigned a value of 50 ;

Hence,

print(val) gives an output of 50

Within the function definition which prints the value of val that is assigned a value of 25 within the function.

Since tbe global variable isnt reset.

Printing Val again outputs 50;since ito is outside the function.

6 0
2 years ago
It's the same drop-down answers for both.
tia_tia [17]

Answer:

First, medium: can see all the subject but maintain the focus in him

Second, close-up: To se the facial expressions and emotions

5 0
2 years ago
In order, the three-step process of using a file in a C++ program involves
Anna71 [15]

Answer:

c. open the file, read/write/save data, close the file

Explanation:

8 0
3 years ago
How do you know when energy is moving in a lightbulb circuit?
vagabundo [1.1K]
When energy flows in the Electric Circuit then Light bulb blows and emits light energy and thermal energy. By that sign, we can get an idea that energy is flowing.

Hope this helps!
4 0
3 years ago
Other questions:
  • What is client server relationship is the basic form of what
    6·1 answer
  • Jabari is writing a program which prompts a user for a value with a decimal. Which function should he use? float() int() print()
    9·2 answers
  • 3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate a
    15·2 answers
  • Copyright laws protect:This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this task a
    6·1 answer
  • Who watches the show gravity falls, if you do, if you play the theme song for the first episode backwards you get a hiding messi
    11·2 answers
  • Pro and Cons of Artificial Intelligence in Art <br><br> You must have 3 statements in each
    14·1 answer
  • I need help 50 points and brainless if you answer
    7·1 answer
  • A Network Intrusion Detection System watches for potentially malicious traffic and _______ when it detects an attack.
    15·1 answer
  • Question 5 / 15
    11·2 answers
  • I will give brainyest
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!