473,671 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Program to find average, min and max

3 New Member
I want to write a program that read n numbers and perform some mathematical tasks on them. The task available for the user is as follow :

1- Finding the average
2- Find the maximum number
3- Find the minimum number
4- Sort the numbers: store the sorted numbers in different memory location

Use pointers. DO NOT USE ARRAY. All program should deal with pointers. Use pointer/offset notation only. Do not use pointer/subscript notation.

(( use function to do that ))

it's realy hard problem :(
Oct 7 '07 #1
5 4365
oler1s
671 Recognized Expert Contributor
What's your question?
Oct 7 '07 #2
NoOoR
3 New Member
I want any one can help me to solve this problem
Oct 7 '07 #3
Ganon11
3,652 Recognized Expert Specialist
Sure, we'd love to help you. So...what part are you having trouble with?

P.S. If you say, "All of it!" we will politely ask you to at least try first. We're not here to do your homework for you - only to help you out.
Oct 7 '07 #4
NoOoR
3 New Member
ok

to be specific my question is

how do i use sorting in pointer i want the idea !
Oct 8 '07 #5
oler1s
671 Recognized Expert Contributor
how do i use sorting in pointer i want the idea !
Well, you know how to sort an array right? Since the objective of this assignment is to use pointer notation, in your sort method, don't use array subscript notation, change it's representation to pointer notation. That's about it.

If you're confused, it's for two reason:
1) You don't know how to sort an array. Have you covered sorting algorithms in class?
2) You don't know how to use pointer notation with an array. You need to do some reading.
Oct 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

27
3099
by: Mark A. Nicolosi | last post by:
I've been trying to learn C for quite a while. But I've had trouble with the lack of good quality online text (some of it's alright). But I finally bought a book on C, Practical C. I like it alot. I'm pretty familiar with the C basics, because I've been trying to learn it for a while. But anyone, I wrote a program to average any number of arguments given at the command line. I thought it might
9
6886
by: ehabaziz2001 | last post by:
I am facing that error message with no idea WHY the reason ? "Abnormal program termination" E:\programs\c_lang\iti01\tc201\ch06\ownarr01o01 Enter a number : 25 More numbers (y/n)? y Enter a number : 30 More numbers (y/n)? n
5
2236
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...
21
2542
by: asif929 | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to run, However, i simply created this program in arrays and it runs good except i cant figure out how to compute the standard deviation. The coding is below. Any help will be appreciated. 1) The Program will prompt the user for six grades to be...
1
3559
by: sparkid | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to run, However, i simply created this program in arrays and it runs good except i cant figure out how to compute the standard deviation. The coding is below. Any help will be appreciated. 1) The Program will prompt the user for six grades to be...
6
4337
by: phkram | last post by:
Hello everybody... i find this place very helpful. anyone who can help me solve the following problems? Thank you very much for helping me.. 1. Build a header file that consists of a class Integer. The class should be capable of computing the sum, difference, product, quotient, and factorials of two numbers. Build an implementation file that uses the newly-built ADT(Abstract Data Type) Integer 2. Write a program that will determine the...
9
3398
by: gdarian216 | last post by:
I have written a c++ program that takes input from a file and outputs the average. The program uses structs and I need to convert the struct to a class. I just dont know how to get started and if I will have to re-write my whole program. #include <cstdlib> #include <iostream> #include <string> #include <vector> #include <fstream> using namespace std;
4
2383
by: Break2 | last post by:
I am trying to write a simple program which asks a user to enter 5 integers after which the average will be computed and written to the screen. That simple. However I want to do it according to a standard I used before to write a program which asked a user to enter the current year and his birthyear after which the current age of the user was computed and written to the screen. I got some help with the second program from some of you, thanks...
3
2267
by: Starbuck01 | last post by:
I have to write a program for my AP Computer Science Class. Here is the instructions. The Police Department is asking for help in catching those who speed. You will write a batch style program (read data from a file) where the first set of data includes the distance in feet of an area marked off on a parkway and the speed limit (miles per hour) for that parkway. The rest of the data includes the time in seconds of how long it took a driver to...
1
1600
by: Sleepwalker817 | last post by:
Hello, I am trying to create a program that is supposed to calculate and print the average of several grades entered by the user. The output is supposed to look something like this: ---------------------------------------------------------------------- This program calculates the average of as many grades you wish to enter. First, enter the number of grades to process: 4
0
8401
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
8926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8824
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...
1
8603
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8673
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4227
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
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2818
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
1815
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.