473,386 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Please solve my problem

Pronlem# 1: How can I Create a notepad file named number.txt which
consists of int type numbers separated with new lines on your hard
disk, a program which read the numbers form this file and show them to
screen, also display the total numbers in files and largest and
smallest numbers to the screen. Please guide me I will be very thank
full to you.

problem # 2: Write a simple structure named Students. This structure
consists of three variables Name, GPA and TotalMarks. Now write three
variables of data type Students. Get value from user for these three
students and show them on screen.

May 22 '07 #1
4 2074
* Ka**********@gmail.com:
Pronlem# 1: How can I Create a notepad file named number.txt which
consists of int type numbers separated with new lines on your hard
disk,
That I won't tell you. Lay off my hard-disk.

a program which read the numbers form this file
Ditto.

and show them to
screen, also display the total numbers in files and largest and
smallest numbers to the screen. Please guide me I will be very thank
full to you.
This sounds like homework.

Read the FAQ's advice about posting homework questions.
problem # 2: Write a simple structure named Students. This structure
consists of three variables Name, GPA and TotalMarks. Now write three
variables of data type Students. Get value from user for these three
students and show them on screen.
This sounds like homework.

Read the FAQ's advice about posting homework questions.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
May 22 '07 #2
On May 22, 3:47 am, Kausar.Na...@gmail.com wrote:
Pronlem# 1: How can I Create a notepad file named number.txt which
consists of int type numbers separated with new lines on your hard
disk, a program which read the numbers form this file and show them to
screen, also display the total numbers in files and largest and
smallest numbers to the screen. Please guide me I will be very thank
full to you.
There is no such thing as a notepad file, you mean a plain text file.
You can open Notepad and just create the file using the keyboard.
Reading from that file should be a simple task using a std::fstream
(std file stream).
I'ld suggest a std::vector< int to store the integers.
>
problem # 2: Write a simple structure named Students. This structure
consists of three variables Name, GPA and TotalMarks. Now write three
variables of data type Students. Get value from user for these three
students and show them on screen.
That question gets asked a lot here (its Student, not Students). The
funny thing is most that do ask about it at least show an attempt at
creating the type Student.

May 22 '07 #3
On 22 mei, 10:10, Salt_Peter <pj_h...@yahoo.comwrote:
On May 22, 3:47 am, Kausar.Na...@gmail.com wrote:
Pronlem# 1: How can I Create a notepad file named number.txt which
consists of int type numbers separated with new lines on your hard
disk, a program which read the numbers form this file and show them to
screen, also display the total numbers in files and largest and
smallest numbers to the screen. Please guide me I will be very thank
full to you.

There is no such thing as a notepad file, you mean a plain text file.
You can open Notepad and just create the file using the keyboard.
Reading from that file should be a simple task using a std::fstream
(std file stream).
I'ld suggest a std::vector< int to store the integers.
problem # 2: Write a simple structure named Students. This structure
consists of three variables Name, GPA and TotalMarks. Now write three
variables of data type Students. Get value from user for these three
students and show them on screen.

That question gets asked a lot here (its Student, not Students). The
funny thing is most that do ask about it at least show an attempt at
creating the type Student.
You are very hard on this poster. Maybe he is just a student which
spents to much time in the pub (I get a deja vu feeling).

You should get an A if you try Boost.Serialization (www.boost.org).
Serializing integers / structs to (and from) file is then only a
matter of writing the correct archive operator.

If you don't have that ambition using ostream_iterators and
istream_iterators on std::fstream will do the job as well.
May 22 '07 #4
<Ka**********@gmail.comwrote:
Pronlem# 1: How can I Create a notepad file named number.txt which
consists of int type numbers separated with new lines on your hard
disk, a program which read the numbers form this file and show them to
screen, also display the total numbers in files and largest and
smallest numbers to the screen. Please guide me I will be very thank
full to you.
There are two parts to this. Create the file and then process the file.
You can do the first part with the Notepad program on your computer.

Pseudocode for part 2.
-----
open the file
smallest so far = a very big number
biggest so far= a very small number
ct = 0
repeat
read a datum
update the variables
until done
print the results
close the file
-----
problem # 2: Write a simple structure named Students. This structure
consists of three variables Name, GPA and TotalMarks. Now write three
variables of data type Students. Get value from user for these three
students and show them on screen.
I don't see how anyone could possibly help on this without giving the
answer, which is no help at all. I think the question has a significant
flaw, it should be Student, not Students.
May 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: stu_gots | last post by:
I have been losing sleep over this puzzle, and I'm convinced my train of thought is heading in the wrong direction. It is difficult to explain my circumstances, so I will present an identical...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
7
by: Mat | last post by:
I am developping multi-user windows application. i use Access database. user edit, add and delete data from database. Request: when an item is deleted ,added or modified by an user, all others...
5
by: CoreyWhite | last post by:
It is possible to use martingale probability theory to beat some games of chance. In a fair game of coin toss, where the odds reach an equilibrium of 50/50 chain reactions do occur. This can be...
5
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
1
by: shapper | last post by:
Hello, For the past hours I have been trying to solve a problem which is driving me crazy. I have to different codes where the problem to solve is the same: CODE 1 (Transforms a XML...
1
by: rocksoft | last post by:
Hi, I am working in asp.net with C# web application, i have used one textbox and image button for search funtion, i have created one user control for this, but after i have entered...
14
by: rashmidutt | last post by:
hello sir i am making project on vb.net language..and project is on hospital management..its major project..and too many fields are present in its data base..i was connecting data base in forms but...
2
by: itsvineeth209 | last post by:
My task is to create login control without using login control in tools. I shouldnt use sqldatasource or any other. I should use only data sets, data adapters and data readers etc. U had created...
6
by: shapper | last post by:
Hello, I am creating a form that includes a few JQuery scripts and TinyMCE Editor: http://www.27lamps.com/Beta/Form/Form.html I am having a few problems with my CSS: 1. Restyling the Select
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.