Need help for C++ class Run and analyze the program provided as download. Modify
ID: 3569599 • Letter: N
Question
Need help for C++ class
Run and analyze the program provided as download. Modify the downloaded program and add the following features:
1) Add family membership for $60 //20 points
2) Add the code to write new membership accounts to the file "members.txt" //20 points
3) Add choice to view member accounts //20 points
4) Counts of each type of membership processed and display to the console at the end.
Tip - use an array of counters. //10 Points
Documentation // 10 points
Running program // 20 points.
What to submit? source cde, members.txt, executable, screen capture as a zip file.
Note: try to add one new feature to the exiting program then test it before adding the second feature and so on.
Explanation / Answer
#include<stdio.h>
#include<conio.h>
void main() {
struct student {
char name[30];
char sex;
int rollno;
float percentage;
};
union details {
struct student st;
};
union details set;
printf("Enter details:");
printf(" Enter name : ");
scanf("%s", set.st.name);
printf(" Enter roll no : ");
scanf("%d", &set.st.rollno);
flushall();
printf(" Enter sex : ");
scanf("%c", &set.st.sex);
printf(" Enter percentage :");
scanf("%f", &set.st.percentage);
printf(" The student details are : ");
printf(" ame : %s", set.st.name);
printf(" Rollno : %d", set.st.rollno);
printf(" Sex : %c", set.st.sex);
printf(" Percentage : %f", set.st.percentage);
getch();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.