473,800 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2089
* Ka**********@gm ail.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...@gm ail.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...@gm ail.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.Serializa tion (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_iterato rs and
istream_iterato rs on std::fstream will do the job as well.
May 22 '07 #4
<Ka**********@g mail.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
3308
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 make-believe challenge in order to avoid confusing the issue further. Suppose I was hosting a dinner and I wanted to invite exactly 12 guests from my neighborhood. I'm really picky about that... I have 12 chairs besides my own, and I want them all...
23
3292
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 to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
7
1658
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 user in the network which has application running should automatically see the change. in case of remove action, the item should disappear from the listview.
5
2240
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 explained using martingale probability theory, but in simpler terms it only shows an example of how order emerges out of chaos. Example: One player has 3 pennies, and another player has only 1 penny. A fair coin is tossed every round to determine...
5
2583
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
1707
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 document using a XSL file): Function Trans()
1
2106
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 value in textbox, i have pressed the button, its not at all working, if i will use mouse i can able to search values, how to enable to enter key at keydown event of textbox, the following script i have used ,
14
3470
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 there is coming error..SIR PLEASE SORT OUT ERROR FROM MY COADING..what can i do to solve this error please give me sugession or if you can send me coading for adding information from form.than i will be thankfull to u..i have written all fields which...
2
2378
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 table login with fields username(varchar(50)), password(varchar(50)), firstname(varchar(50)), lastname(varchar(50)). U had to display username , first name, last name in default.aspx page after login. One more condition is that, if user fails login...
6
2197
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
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10276
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9090
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.