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
To view paragraph marks, click on the ______ tab, in the paragraph group, click show/hide
sergejj [24]

Answer:

Home

Explanation:

Thank Quizlet, lol!

3 0
3 years ago
Bert started off his working life as a typesetter for a print house. With the advent of new technologies, Bert's job became redu
Inessa [10]

Answer:

Berth's job became redundant because she lacks the computing skills. Perhaps, she has been using manual or analog type writing machine to do her job and was doing it well but with the advent of computer that replaces analog type writer, she will become redundant.

Explanation:

She needs to learn how to use the computer to type and do her job efficiently in the print industry.

5 0
3 years ago
Initialize a list. ACTIVITY Initialize the list short.names with strings 'Gus', Bob, and 'Ann'. Sample output for the given prog
Ksenya-84 [330]

Answer:

shortNames = ['Gus', 'Bob','Zoe']

Explanation:

In this assignment, your knowledge of list is been tested. A list is data structure type in python that can hold different elements (items) of different type. The general syntax of a list is

listName = [item1, "item2", item3]

listName refers to the name of the list variable, this is followed by a pair of square brackets, inside the square brackets we have items separated by commas. This is a declaration and initialization of a list with some elements.

The complete python code snippet for this assignment is given below:

<em>shortNames = ['Gus', 'Bob','Zoe']</em>

<em>print(shortNames[0])</em>

<em>print(shortNames[1])</em>

<em>print(shortNames[2])</em>

3 0
3 years ago
What are some differences between CUI and GUI ?
ollegr [7]

Answer:

Even though both are interfaces and serve its purpose of attempting to run the strategies, their components as well as the manipulate they will get from the patient differ.

Explanation:

CUI (Character User Interface) :-

  • It's a sort of user interface that only uses binary data and pseudographics for interface-output and data sessions.
  • That's characterized by low availability for operating systems I / O resources (act with integrity) and high speed with a display of data.

GUI (Graphical User Interface (GUI):-

  • Using graphical elements such as windows, icons, menus helps the user to communicate with the program.
  • It is a kind of user interface along which people interact with electronic equipment through characterizations of visual indicators.
3 0
3 years ago
Write a program that reads a 4-bit binary number from the keyboard as a string and then converts it into decimal. For example, i
adell [148]

Answer:

import java.util.Scanner;

public class ss11{

       public static void main (String[]args) {

             Scanner keyboard = new Scanner (System.in)

             String a1, a2, a3, a4, a5;

              int i1, i2, i3, i4, i5;

              System.out.println("Enter a four bit binary number:");

               a1= keyboard.next();

               a2= a1.substring(0,1);

               a3= a1.substring(1,2);

               a4= a1.substring(2,3);

               a5= a1.substring(3,4);

                i1 = Integer.parseInt(a2);

                i2 = Integer.parseInt(a3);

                i3 = Integer.parseInt(a4);

                i4 = Integer.parseInt(a5);

                i1= i1 * 8;

                i2= i1 * 4;

                i3= i1 * 2;

                i4= i1 * 1;

                i5= i1+i2+i3+i4;

                System.out.println("The converted decimal number is: +i5);

}

}

Explanation:

7 0
3 years ago
Other questions:
  • Dial-up connections can be made over a(n) ____ line or phone line. isdn dsl ipx tcp/ip
    12·1 answer
  • True false) ther are five arrow keys on the keborad​
    9·1 answer
  • By Carl Sandburg
    6·1 answer
  • What command is used to generate an RSA key pair?
    9·1 answer
  • Implement a java program to find the smallest distance between two neighbouring numbers in an array.
    7·1 answer
  • Why do we need vram​
    6·1 answer
  • What is software and explain the five types of software
    5·2 answers
  • Which tab should be selected to add a hyperlink within a cell? Home tab Review tab Insert tab Formula tab
    12·2 answers
  • Direction: using the data at the left, answer the questions that follows.​
    11·1 answer
  • Price of ETH coin right now?<br> Don't answer if u don't know.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!