Information Technology > Research Paper > Northern Virginia Community College - ITN 100ProjectPart4. (All)
ITP100 Exam 3 (Some answers shared only - only the bigger problems) Q5: Assume arrays created and loaded with data start main call displayData(states[], votes[], size) call displayTotalVotes(vote ... s[], size) call mostElectoralVotes(states[], votes[], size) call displayFewer(states[], votes[], size) end main void displayData(string states[], int votes[], int size) for(int i from 0 to size-1) output "State: ", states[i] output "Votes: ", votes[i] end for end displayData void displayTotalVotes(int votes[], int size) int total = 0 for(int i from 0 to size-1) total = total + votes[i] end for output "Total votes in all ", total end displayTotalVotes void mostElectoralVotes(string states[], int votes[], int size) int maxVotes = votes[0] int index for(int i = 1 to size-1) if(votes[i] > maxVotes) index = i end if end for output "State with most electoral votes ", states[index]end mostElectoralVotes void displayFewer(string states[], int votes[], int size) [Show More]
Last updated: 3 years ago
Preview 1 out of 10 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Mar 17, 2021
Number of pages
10
Written in
All
This document has been written for:
Uploaded
Mar 17, 2021
Downloads
0
Views
73
Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·