Find Jobs
Hire Freelancers

Arrays and Strings

$20-25 USD

Ukończony
Opublikowano około 21 lat temu

$20-25 USD

Płatne przy odbiorze
Write a program which reads a list of grade point averages into an array of type double (and size 10). After the program has completed reading, the contents of the array are printed out. Define and use a function which prompts the user for a grade point average (or negative value to end) and reads the value. The function, in a loop: 1. checks that a valid number has been entered (see scan_fraction logic from lab05) 2. if the value is negative (input end signal), return -1 3. check that the number entered is in the range 0 to 4.0. If either check fails, write an error message “invalid gpa, entry ignored?? and repeat the loop. The function has one output argument (gpa) and returns 0 (if a valid gpa has been entered) or ??"1 to signal that reading terminates. Your program (main) will, in a loop, repeatedly call this function for gpa values and, as long as the function returns 0, insert them into the array. The loop terminates: 1. when the function returns ??"1 OR 2. when the array is full The program then prints out the list of gpa values. Test with a list of gpa values less than, equal to, and greater than the capacity of the array. Test the function by supplying a bad gpa (type some letters instead of numbers) and some gpa values outside 0.0 to 4.0. Document this program according to the guidelines. Poorly or non-documented programs will be downgraded. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased. Sample Tests Script started on Fri Mar 28 13:55:55 2003 % gpa_array supply gpa between 0.0 and 4.0 (-1 to exit): -1 Grade Point Averages Array pos gpa % gpa_array supply gpa between 0.0 and 4.0 (-1 to exit): aaa invalid gpa - reenter supply gpa between 0.0 and 4.0 (-1 to exit): 5.2 gpa out of range -reenter supply gpa between 0.0 and 4.0 (-1 to exit): 3.2 supply gpa between 0.0 and 4.0 (-1 to exit): 2.1 supply gpa between 0.0 and 4.0 (-1 to exit): -1 Grade Point Averages Array pos gpa 0 3.20 1 2.10 % gpa_array supply gpa between 0.0 and 4.0 (-1 to exit): 0.1 supply gpa between 0.0 and 4.0 (-1 to exit): 1.2 supply gpa between 0.0 and 4.0 (-1 to exit): 2.3 supply gpa between 0.0 and 4.0 (-1 to exit): 3.4 supply gpa between 0.0 and 4.0 (-1 to exit): 4.1 gpa out of range -reenter supply gpa between 0.0 and 4.0 (-1 to exit): 1.2 supply gpa between 0.0 and 4.0 (-1 to exit): 2.4 supply gpa between 0.0 and 4.0 (-1 to exit): 0.1 supply gpa between 0.0 and 4.0 (-1 to exit): 0.0 supply gpa between 0.0 and 4.0 (-1 to exit): 4.0 supply gpa between 0.0 and 4.0 (-1 to exit): 3.9 Array full -data entry terminated Grade Point Averages Array pos gpa 0 0.10 1 1.20 2 2.30 3 3.40 4 1.20 5 2.40 6 0.10 7 0.00 8 4.00 9 3.90 % exit ## Platform Linux or Unix
Identyfikator projektu: 2923402

Informację o projekcie

17 ofert
Zdalny projekt
Aktywny 21 lat temu

Szukasz sposobu na zarobienie pieniędzy?

Korzyści ze składania ofert na Freelancer.com

Ustal budżet i ramy czasowe
Otrzymuj wynagrodzenie za swoją pracę
Przedstaw swoją propozycję
Rejestracja i składanie ofert jest bezpłatne
Przyznano:
Awatar Użytkownika
See private message.
$7 USD w 14 dni
5,0 (35 opinii)
4,6
4,6
17 freelancerzy składają oferty o średniej wysokości $11 USD dla tej pracy
Awatar Użytkownika
See private message.
$8,50 USD w 14 dni
4,9 (48 opinii)
5,4
5,4
Awatar Użytkownika
See private message.
$17 USD w 14 dni
5,0 (53 opinii)
5,1
5,1
Awatar Użytkownika
See private message.
$14,45 USD w 14 dni
4,9 (79 opinii)
4,7
4,7
Awatar Użytkownika
See private message.
$8,50 USD w 14 dni
5,0 (37 opinii)
3,0
3,0
Awatar Użytkownika
See private message.
$8,50 USD w 14 dni
5,0 (4 opinii)
2,7
2,7
Awatar Użytkownika
See private message.
$8,50 USD w 14 dni
4,8 (17 opinii)
2,7
2,7
Awatar Użytkownika
See private message.
$4,25 USD w 14 dni
4,5 (15 opinii)
2,7
2,7
Awatar Użytkownika
See private message.
$15,30 USD w 14 dni
4,9 (10 opinii)
2,5
2,5
Awatar Użytkownika
See private message.
$12,75 USD w 14 dni
4,7 (2 opinii)
1,3
1,3
Awatar Użytkownika
See private message.
$8,50 USD w 14 dni
5,0 (6 opinii)
1,2
1,2
Awatar Użytkownika
See private message.
$4,25 USD w 14 dni
0,0 (0 opinii)
0,0
0,0
Awatar Użytkownika
See private message.
$17 USD w 14 dni
0,0 (0 opinii)
0,0
0,0
Awatar Użytkownika
See private message.
$12,75 USD w 14 dni
0,0 (0 opinii)
0,0
0,0
Awatar Użytkownika
See private message.
$16,15 USD w 14 dni
0,0 (1 opinia)
0,0
0,0
Awatar Użytkownika
See private message.
$21,25 USD w 14 dni
0,0 (2 opinii)
0,0
0,0
Awatar Użytkownika
See private message.
$4,25 USD w 14 dni
0,0 (0 opinii)
0,0
0,0

O kliencie

Flaga UNITED STATES
United States
5,0
2
Członek od maj 6, 2003

Weryfikacja Klienta

Dziękujemy! Przesłaliśmy Ci e-mailem link do odebrania darmowego bonusu.
Coś poszło nie tak podczas wysyłania wiadomości e-mail. Proszę spróbować ponownie.
Zarejestrowani Użytkownicy Całkowita Liczba Opublikowanych Projektów
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Wczytywanie podglądu
Udzielono pozwolenia na Geolokalizację.
Twoja sesja logowania wygasła i zostałeś wylogowany. Proszę, zalogować się ponownie.