Sponsored Content
Full Discussion: Need a little help
Top Forums UNIX for Dummies Questions & Answers Need a little help Post 302878755 by iGakki on Sunday 8th of December 2013 07:13:12 PM
Old 12-08-2013
Need a little help

thx for reading first, i got some problems with my assignment,
this is the requirements of my assignment:
The program calculates and displays the largest and average of a group of input numbers.
The program should accept the input of a group of numbers, one at a time, each can be up to 2 digits, ended with a 0, and find and display the largest and the average of all valid input numbers (excluding the ending zero). For example, input of 46, -31, 6, 10, 12345, -4, 274 and 0 should result in 46 as the largest and the average of 5, with error messages indicating that 12345 and 274 are invalid.
Any invalid input character (eg. #, a, %, A, etc.) or number exceeding the range should cause an error message and be ignored.

my question is we didnt learn anything about the data type in unix yet, but i find some similar assignment they all use "@", what is "@" means in unix and is there any other ways to deal with this problem but not use "@"
regards~
 
NUMCONV(1)							   User Commands							NUMCONV(1)

NAME
numconv - convert numbers from one number system to another SYNOPSIS
Numconv <options> DESCRIPTION
numconv is a filter that converts integers from one number system to another. For example, it can convert from Roman Numerals such as "CCLVI" to ordinary Western numbers such as "256" or from Western numbers to Chinese. The great majority of number systems, both modern and ancient, are supported, including numerous variants. If the input number system is 'all', the number system will be autodetected. numconv is a command line interface to libuninum a library for converting between textual representations of numbers and machine-internal representations. Further information about the conversions performed is available in the documentation for this library. OPTIONS
-i <input file> Read input from the specified file. -o <output file> Write output into the specified file. -I Identify the number system of the input. -c List the available number system cover terms. -l List the available number systems. -f <input number system> Specify the number system of the input. -t <output number system> Specify the number system of the output. -b <input base> Specify the input base for Western numbers. The base must be in the range [1,36]. -B <output base> Specify the output base for Western numbers. The base must be in the range [1,36]. -g <output general group size> Specify the size of digit groups other than the ow-order group. The default is 3. -G <output low group size> Specify the size of the low-order group of digits. The default is 3. -s <output group separator character> Specify character to use as "thousands separator". The default is a comma. -L Set the output grouping parameters, general group size, first group size, and group separator character, according to the current locale. -m When generating Roman numerals, use unit characters with superscript macron for thousands greater than one instead of Ms. -h Print help information. -v Print version information. EXAMPLES
To convert from Roman Numerals to ordinary Western numbers: numconv -f Roman -t Western_Lower To convert from ordinary Western numbers to the variety of number in current use in the People's Republic of China: numconv -f Western -t Mandarin_Regular_Simplified To convert from ordinary Western numbers to Western numbers in base 2: numconv -f Western_Lower -t Western_Lower -B 2 To convert from Urdu numbers to Hindi numbers with the traditional Indian grouping: numconv -f Perso_Arabic -t Devanagari -g 2 SEE ALSO
libuninum (3) AUTHOR
Bill Poser (billposer@alum.mit.edu) LICENSE
GNU General Public License, version 2. (http://www.gnu.org/licenses/gpl.txt) numconv September 2007 NUMCONV(1)
All times are GMT -4. The time now is 08:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy