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
Nadusha1986 [10]
3 years ago
10

Write a simple compilable program that outputs to an Excel-compatible XLS file these two rows: (1) a header row with headings fo

r each column and (2) a data row with one set of data. You may have addition data rows if you wish.
Include at least 3 columns of information of any kind you like, with real or made-up data. For example, a student record, a stock quote, a weather forecast, etc.
Hint: use the character \t for column breaks and \n for row breaks.
Computers and Technology
1 answer:
ollegr [7]3 years ago
5 0

Answer:

#include <iostream>

#include <fstream>

using namespace std;

struct student

{

string name;

int id;

double average;

};

int main()

{

string filename = "data.csv";

student s[3] = { {"Peter", 101, 65.4},

{"Mary", 102, 60.4},

{"Jed", 103, 55.4}};

ofstream outFile(filename.c_str());

outFile << "Name,ID,Average" << endl;

for(int i = 0; i < 3; i++)

{

outFile << s[i].name << "," << s[i].id << "," << s[i].average << endl;

}

outFile.close();

cout << "Please open " << filename << " in Excel" << endl;

}

Explanation:

Name ID Average

Peter 101 65.4

Mary 102 60.4

Jed 103 55.4

You might be interested in
A department store plans to upgrade its IT infrastructure to support a new order-processing application with rich features. The
atroni [7]
Assuming price doesn't matter:

Processor: 
I'd recommend Intel Core i7 or similar
Hard Drive: An SSD with at least 2TB will do
RAM: I'd recommend around 8GB or more
Operating System: Linux is one of the best OSes out there, I'd recommend using that.
5 0
4 years ago
There are several reasons it’s important to use the right tool and the right size tool for the job, but the most important reaso
Helga [31]

Answer:

ok t dog

Explanation:

4 0
3 years ago
How to control what is on the x and y axis in excel?
kozerog [31]
The value on X you choose first and create a graph then you add values to graphs Y axis.
8 0
3 years ago
What was the best Metal Gear Solid you enjoyed the most?​
kenny6666 [7]

My personal favorite is Metal gear solid 3: <em>Snake eater</em>.

7 0
4 years ago
Jana works in a call center helping people who are having trouble setting up their
olchik [2.2K]

Answer:

Information Support and Services

Explanation:

She works helping people setting up their accounts so she supports with information from her services

4 0
3 years ago
Read 2 more answers
Other questions:
  • In what ways are Outlook notes useful for personal or professional use? Check all that apply.
    13·2 answers
  • An identifying value called a/an ____ is assigned by the java runtime to an object when it is created, to allow the java runtime
    14·1 answer
  • What is the standard internet protocol, which provides the technical foundation for the public internet?
    9·1 answer
  • Then standard toolbar appears whenever you select text true or fals
    15·1 answer
  • Multiple client switches and routers have been set up at a small military base. The network team decided to implement Terminal A
    15·1 answer
  • C++
    11·2 answers
  • PLEASE HELP
    5·1 answer
  • How do you invite someone to a conversation on brainly
    14·1 answer
  • The ____ attribute can be used only with input boxes that store text. Group of answer choices type pattern required value
    9·1 answer
  • AJ created a list, and he needs all of the numbers to be in order. Which Python function will allow him to organize his list num
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!