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
Klio2033 [76]
3 years ago
15

Suppose you have a programmer-defined data type Data and want to overload the << operator

Computers and Technology
1 answer:
KATRIN_1 [288]3 years ago
5 0

Answer:

(a) ostream &operator<<(ostream &output, const Data &dataToPrint)

Explanation:

If you have a programmer-defined data type Data and want to overload the << operator to output your data type to the screen in the form cout <<dataToPrint; and allow cascaded function calls.

The first line of the function definition would be;

ostream &operator<<(ostream &output, const Data &dataToPrint)

You might be interested in
C. An error that due to wrong input.​
ladessa [460]

c. An error that due to wrong input.

=> Bug

<em>Hope </em><em>it</em><em> is</em><em> helpful</em><em> to</em><em> you</em>

6 0
3 years ago
A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the clie
Paul [167]

Answer:

Complete solution is given below:

Explanation:

Java code:

//Header file section

import java.util.Scanner;

import java.io.*;

//main class

public class SalesTestDemo

{

//main method

public static void main(String[] args) throws IOException

{

  String inFile;

  String line;

  double total = 0;

Scanner scn = new Scanner(System.in);

//Read input file name

System.out.print("Enter input file Name: ");

inFile = scn.nextLine();

FileReader fr = new FileReader(new File(inFile));

BufferedReader br = new BufferedReader(fr);

System.out.println("Name \t\tService_Sold \tAmount \tEvent Date");

System.out.println("=====================================================");

line = br.readLine();

//Each line contains the following, separated by semicolons:

//The name of the client, the service sold

//(such as Dinner, Conference, Lodging, and so on)

while(line != null)

{

String temp[] = line.split(";");

for(int i = 0; i < temp.length; i++)

{

System.out.print(temp[i]+"\t");

if(i == 1)

System.out.print("\t");

 

}

//Calculate total amount for each service category

total += Double.parseDouble(temp[2]);

System.out.println();

line = br.readLine();

}

//Display total amount

System.out.println("\nTotal amount for each service category: "+total);

}

}

inputSale.txt:

Peter;Dinner;1500;30/03/2016

Bill;Conference;100.00;29/03/2016

Scott;Lodging;1200;29/03/2016

Output:

Enter input file Name: inputSale.txt

Name        Service_Sold    Amount    Event Date

=====================================================

Peter   Dinner       1500   30/03/2016  

Bill   Conference       100.00   29/03/2016  

Scott   Lodging       1200   29/03/2016  

Total amount for each service category: 2800.0

7 0
3 years ago
To see if a website is using a secure connection, what should you look for? Select all that apply.
kupik [55]

Answer:

– A web address using “HTTPS” (The extra “S”means it’s a secure connection. – Secure sites show a closed padlock emblem you can click on for security details – the most trustworthy sites will have green padlocks or address bars.

Explanation:

6 0
3 years ago
What are the possible consequences if you fail to identify system requirements correctly and completely?
AlladinOne [14]
There are a few consequences for failing to identify system requirements. 

1. Strain on time and effort which can cost money for either a company or yourself (depending if you are an employer, employee, etc).

2. Additional costs for hardware. If you decide to upgrade your hardware on a later time. It will cost additional money for repairs and replacements to adjust.

3. It can cause dissatisfaction to a user if you are working as a technician (for example) which can leave a negative mark on your reputation/resume) 
4 0
4 years ago
Keira is using the software development life cycle to create a new app. She has the pseudocode for her program. Which stage of t
kodGreya [7K]

Keira is using the software development life cycle to create a new app. She has the pseudocode for her program. The next stage for Keira is CODING.

Explanation :

  • SDLC or the Software Development Life Cycle is a process that produces software with the highest quality and lowest cost in the shortest time. SDLC includes a detailed plan for how to develop, alter, maintain, and replace a software system.
  • SDLC involves several distinct stages, including planning, design, building, testing, and deployment. Popular SDLC models include the waterfall model, spiral model, and Agile model.
  • The steps of the SDLC are given below :
  • Identify the current problems. “What don’t we want?”
  • Plan. “What do we want?”
  • Design. “How will we get what we want?”
  • Build. “Let’s create what we want.” This SDLC stage develops the software by generating all the actual code. If the previous steps have been followed with attention to detail, this is actually the least complicated step.
  • Build is the phase which Keira should move onto in the SDLC
  • SDLC done right can allow the highest level of management control and documentation. Developers understand what they should build and why. All parties agree on the goal up front and see a clear plan for arriving at that goal. Everyone understands the costs and resources required.
7 0
3 years ago
Read 2 more answers
Other questions:
  • Theâ ______ is a large worldwide collection of networks that use a common protocol to communicate with one another.
    5·1 answer
  • What is the primary purpose of a business plan? To file for incorporation To help you identify your goals and plan how you will
    6·1 answer
  • Which of the following statements is true?
    10·1 answer
  • The integer variables first and last have been declared and assigned values (with last &gt;= first). Allocate an integer array t
    10·1 answer
  • cd to the directory called final that is located within my home directory. While viewing the file called mypasswd you notice tha
    12·1 answer
  • Will a pair of bar magnet ,with keepers on the two ends, act as a magnet
    13·1 answer
  • Is it better to meet online or offline<br> (Please answer QUICK)<br><br> Thanks :')
    5·2 answers
  • An administrative assistant types a document, saves, and prints. The assistant is using _____.
    13·1 answer
  • Differentiate between CD-ROMS and DVD-ROMS​
    8·1 answer
  • If ADD = 81, BAD = 49, and CAD = 64, then what is the value of ACA?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!