Cs201 Assignment 2 Solution Fall2020 |
Total Marks: 20
Due Date: 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:
Assignment is submitted after due date. Submitted assignment does not open or file is corrupt. Assignment is copied (From internet/students).
Software allowed to develop Assignment
– Dev C++
Objectives: In this assignment, the students will learn:
Assignment Submission Instructions You are required to submit only .cpp file on the assignments interface of CS201 at VU-LMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.
|
|
Cs201 Assignment 2 Solution Fall 2020Click Here |
As all of you know that presidential election was conducted in USA recently, and the entire world had an eye on the results. There were three main candidates; Donald Trump from Republicans party, Joe Biden from Democrats and Jo Jorgensen as an independent candidate. Though the strong candidates for this presidential election 2020 were Trump and Biden, and there was tough competition among them. Similarly, some states of USA have played the role of Crucial states (Winning states) to win the election. In this assignment you will be provided with data from USA election 2020 and you have to write C++ program according to the given data.
Problem Statement Write a menu in C++ which should show the state code and name of winning states at the start of application: 1 for Florida. 2 for Georgia. 3 for Michigan. Press 4 to exit.
Source data: (Use two dimensional array to store following data)
[above dummy data is for assignment purpose only] Instructions to write C++ program:
Ø 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. Cs201 Assignment 2 Solution Fall 2020Click Here
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. Similarly, If user presses 3 then it will show the percentage of Biden, Trump and Jorgensen votes from state Michigan. If the user enters option other then 1 to 4. Following messages display: Choice should be between 1 and 4 Invalid choice, please select again: Cs201 Assignment 2 Solution Fall 2020Click HereWish you Good Luck!
|