Assignment Submitted in Any Other Format Will Not Be Accepted and Will Be Graded Zero Marks
Assignment Submitted in Any Other Format Will Not Be Accepted and Will Be Graded Zero Marks
2 Total Marks: 20
Semester: Fall 2020 Due Date:
CS201 – Introduction to Programming 18-12-2020
Instructions
Please read the following instructions carefully before submitting the assignment:
It should be clear that your assignment will not get any credit if:
- Dev C++
Objectives:
In this assignment, the students will learn:
How to fill / populate a two-dimensional array using given source data.
How to write user defined functions and pass an array to them as parameter.
How to use if statement and do while loop.
How to calculate the percentage in elements of array.
How to display array elements.
You are required to submit only .cpp file on the assignments interface of CS201 at VU-LMS.
Problem Statement
Write a menu in C++ which should show the state code and name of winning states at the start of application:
1. Press 1 for Florida.
2. Press 2 for Georgia.
3. Press 3 for Michigan.
4. Press 4 to exit.
Source data:
(Use two dimensional array to store following data)
Write functions to calculate %age of Joe Biden votes, %age of Donald Trump votes and %age of Jo
Jorgensen votes in specific State. Following function names should be used for consistency.
First, user will call the showElements() method to display all the source data in matrix form. Then, it will display a
menu to calculate the percentage of Biden, Trump and Jorgensen votes for specific state:
If user presses 1 then it will show the percentage of Biden, Trump and Jorgensen votes from state Florida.
If user presses 2 then it will show the percentage of Biden, Trump and Jorgensen votes from state Georgia.