CS506 Assignment 1 Solution Spring 2021
employee.txt
1110, ALI, CS, MS, 5, 70000
1120, Abdullah, MGT, PhD, 10, 125000
1022, Ilyas, Bio, Master, 7, 50000
1022, Ahmad, MassCom, MS, 3, 60000
CS506 Assignment 1 Solution Spring 2021
employee.txt
1110, ALI, CS, MS, 5, 70000
1120, Abdullah, MGT, PhD, 10, 125000
1022, Ilyas, Bio, Master, 7, 50000
1022, Ahmad, MassCom, MS, 3, 60000
Sample Output
A1 Sample Output.mp4
Re: CS301 Assignment 1 Solution and Discussion
Assignment No. 1
Semester: Spring 2021
CS301 – Data Structures Total Marks: 20
Due Date: 18/05/2021
Instructions
Please read the following instructions carefully before submitting the assignment solution:
It should be clear that your assignment will not get any credit/marks if:
o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/students).
Recommended Tools
• Dev C++
Objectives:
To enable students to understand and practice the concepts of:
• Linked list implementation
• Efficient memory management
• Efficient use of pointer
Assignment Submission Instructions
You have to submit only .zip file which will have code (.cpp) and screenshot image files on the assignments interface from your LMS account.
Assignment submitted in any other format will not be accepted and will be scaled with zero marks. No excuse will be accepted on submitting solution file in any other format.
For any query related to assignment, please contact [email protected].
Problem Statement:
In the lesson videos and handouts you learned to save only one integer element as data in a node. Please note, it is not compulsory to have only one value in a node. There can be more than one and different types of elements as data of a node but pointer will remain one for singly linked list.
Write a C++ program to implement linked list data structure. In this problem every node should have two data elements called name and course of a student and a pointer to link the current node to the next node. Your program should prompt the user to enter name and course code of a student and save it into a Node (Student). User can enter the records of multiple students. So you need to create a linked list of students. One node of list will represent one student.
Instead of saving the name of course you should use code of course into Student node. This will help you save lots of memory. “short int” type variable can be used to save code of course which will take two bytes while name of course will take many bytes. This technique will help you save lots of memory.
Use the following course names and codes while entering the record of a student.
Course Name Course Code
Introduction to Computing 1
Introduction to Programming 2
Data Structures 3
Object Oriented Programming 4
After saving the required information of all students, you need to perform following operations operated through menu showing in sample output video.
• Show the names of students enrolled in a specific or all courses (user will enter a choice of operation).
• Show the count of students enrolled in a specific or all courses (user will enter a choice of operation).
• Option to close the program by selection from menu as showing in sample output video.
• While testing your application and entering the record of first student, use your VU ID for the name of student. Take screenshot of your input which should be showing your VU ID entered as first student name. Zip your code (.cpp) and screenshot image files and submit zip file from your LMS account.
Sample Output:
For sample output watch the video file “A1 Sample Output.mp4” attached with this assignment file.
Lectures Covered: (Lecture # 1- 8) and Due date to submit solution: (Tuesday, May 18, 2021).
Solution:
//vu id XXXXXXXXXXXXXXXXXX
#include <iostream>
#include <conio.h>
using namespace std;
class student{
public:
string name;
int code;
student* next_add;
};
class linked_list{
public:
student *head=NULL;
void menu();
int get_code();
string set_name();
string get_name();
string set_name(string n);
void insert();
void show_all();
void show_one();
void show_two();
void show_three();
void show_four();
};
string linked_list::get_name(){
string name;
cout<<"enter the name of the student: ";
cin>>name;
return name;
}
int linked_list::get_code(){
int code;
cout<<"\n\n1. introduction to computing: " ;
cout<<"\n2. introduction to programming ";
cout<<"\n3. data structures ";
cout<<"\n4. object oriented programming ";
cout<<"\nEnter the course name ";
cin>>code;
return code;
}
string linked_list::set_name(string n){
return n;
}
void linked_list::insert(){
student *new_node=new student;
new_node->name=get_name();
new_node->code=get_code();
new_node->next_add=NULL;
if(head==NULL){
head=new_node;
}
else{
student*ptr=head;
while(ptr ->next_add!=NULL){
ptr=ptr->next_add;
}
ptr->next_add=new_node;
}
cout<<" students information saved successfully.";
}
void linked_list::menu(){
p:
int choice;
cout<<"\n\n0. display all students ";
cout<<"\n1. display all students enrolled in introduction to computing ";
cout<<"\n2. display all students enrolled in introduction to programming ";
cout<<"\n3. display all students enrolled in data structures ";
cout<<"\n4. display all students enrolled in object oriented programming ";
cout<<"\n5. close the program ";
cout<<"\n\n select an option for required operation: ";
cin>>choice;
switch(choice){
case 0:
show_all();
break;
case 1:
show_one();
break;
case 2:
show_two();
break;
case 3:
show_three();
break;
case 4:
show_four();
break;
case 5:
exit(0);
}
goto p;
}
void linked_list::show_all(){
int count=0;
cout<<"\n\nfollowing students are enrolled in all courses: ";
student *ptr=head;
while(ptr!=NULL){
cout<<"\nStudent name: " <<set_name(ptr->name);
count ++;
ptr=ptr->next_add;
}
cout<<"\nenrollemnet count " <<count ;
}
void linked_list::show_one(){
int count=0;
cout<<"\n\nfollowing students are enrolled in intoduction to computing: ";
student *ptr=head;
while(ptr!=NULL){
if(ptr->code==1){
cout<<"\nStudent name: "<<set_name(ptr->name);
count ++;
}
ptr=ptr->next_add;
}
cout<<"\nenrollement cout:"<<count;
}
void linked_list::show_two(){
int count=0;
cout<<"\n\nfollowing students are enrolled in intoduction to computing: ";
student *ptr=head;
while(ptr!=NULL){
if(ptr->code==2){
cout<<"\nStudent name: "<<set_name(ptr->name);
count ++;
}
ptr=ptr->next_add;
}
cout<<"\nenrollement cout:"<<count;
}
void linked_list::show_three(){
int count=0;
cout<<"\n\nfollowing students are enrolled in intoduction to computing: ";
student *ptr=head;
while(ptr!=NULL){
if(ptr->code==3){
cout<<"\nStudent name: "<<set_name(ptr->name);
count ++;
}
ptr=ptr->next_add;
}
cout<<"\nenrollement cout:"<<count;
}
void linked_list::show_four(){
int count=0;
cout<<"\n\nfollowing students are enrolled in intoduction to computing: ";
student *ptr=head;
while(ptr!=NULL){
if(ptr->code==4){
cout<<"\nStudent name: "<<set_name(ptr->name);
count ++;
}
ptr=ptr->next_add;
}
cout<<"\nenrollement cout:"<<count;
}
main(){
linked_list obj;
char x;
do {
obj.insert();
cout<<"\ndo you want to add another student?" ;
cin>>x;
}
while(x=='Y'||x=='y');
obj.menu();
}
@zareen said in CS504 Assignment 1 Solution and Discussion Spring 2020:
Question No 1:
Solution:
Functional Requirements:
- Buyers can request a catalogue of the Air Conditioners stock.
- Sellers can post information/details about their Air Conditioners online
- AIR Wave will notify successful tenders
- Online registration is required for both sellers and buyers.
- The interfaces should be customizable so that a wide variety of users could use the
system effectively.
Question No 1:
Solution:
Functional Requirements:
It is true or wrong that Raise For Success an automobile at rest can be accelerating very fast?
Yes! Please contact us for promotion posts only. We’re always looking for new authors. Get in touch for pricing and information.
You’ve come to the right place for guest post guidelines to pitch your ideas about the education and craft of freelance writing. Writing to help writers make money writing by finding better-paying gigs, and teach freelancers about how to move up and earn more.
What you can post?
Cyberian is tightly focused on education stories, Technologies, Reviews, Lifestyle, and business news content. We are looking for authors or writers who can write for us and we can publish original articles to reveal how distance learning can help to educate the world and rural area can be educated with distance learning in this global village began their journey, The secret behind their success, How Education use innovative ideas and strategies to mark impactful presence globally, Distance learning, Digital marketing, Human Resources, and the latest technological innovations. We like to work with individual authors. If your startup founder or CEO is interested to write for us. That would be great. Bring them on and send them all the guidelines as mentioned below.
What should follow while ”write for us”?
What we don’t like to publish?
Guidelines to Follow before Article Submission
Use the contact chat to get in touch. You will receive a feedback today.
You can also get calculation results from google voice search, try saying “what is 10 percent of 5000” it will answer you
Aoa sir why we convert binary into decimal by negative signs on digits??
@zareen said in MTH603 Assignment 2 Solution and Discussion:
Question 1:
Obtain the value of using Simpson’s 1/3 rule correct to 3 decimal places.
MARKS 10
Solution Idea.
We evaluate the given integral by the formula
S4=Δx3[f(x0)+4f(x1)+2f(x2)+4f(x3)+2(x4)].
Determine the width of the subinterval:
Δx=b−an=1−04=14.
Compute the function values at the endpoints of the subintervals:
f(x0)=f(0)=e0=1;
f(x1)=f(14)=e14=4√e≈1.2840;
f(x2)=f(12)=e12=√e≈1.6487;
f(x3)=f(34)=e34=4√e3≈2.1170;
f(x4)=f(1)=e1=e≈2.7183;
Plugging in the function values into our equation, we get:
1∫0exdx≈S4=112[1+4×1.2840+2×1.6487+4×2.1170+2.7183]=112×20.6197=1.7183≈1.718
Re: MTH603 Assignment 2 Solution and Discussion
Assignment NO. 2 MTH603 (Fall 2020)
Maximum Marks: 20
Due Date: February 15, 2021
DON’T MISS THESE: Important instructions before attempting the solution of this assignment:
• To solve this assignment, you should have good command over 23 - 35 lectures.
Try to get the concepts, consolidate your concepts and ideas from these questions which you learn in the 23-35lectures.
• Upload assignments properly through LMS, No Assignment will be accepted through email.
• Write your ID on the top of your solution file.
Don’t use colourful back grounds in your solution files.
Use Math Type or Equation Editor Etc. for mathematical symbols.
You should remember thatif we found the solution files of some students are same then we will reward zero marks to all those students.
Try to make solution by yourself and protect your work from other students, otherwise you and the student who send same solution file as you will be given zero mark.
Also remember that you are supposed to submit your assignment in Word format any other like scan images etc. will not be accepted and we will give zero mark corresponding to these assignments.
Question 1:
Obtain the value of using Simpson’s 1/3 rule correct to 3 decimal places.
MARKS 10
Question 2:
Using Newton’s divided difference formula, find the quadratic equation for the following data:
X 1 2 5
Y 8 14 44
Hence find y(3). MARKS 10
@zareen said in MGT201 Assignment 1 Solution and Discussion:
Re: MGT201 Assignment 1 Solution and Discussion
Assignment #01Marks =20
Risk, Return and Investment Decisions Investment decisions are supported by various factors including investor choice of risk appetite, return on investment and most important the market situation that is backed by supply and demand forces. The supply and demand impact is reflected in the market price of securities and guide investors to take a rational decision.Along with market forces, company specific information is also helpful in determining the fair price of an investment. Rational investor s consider both market and company specific information to choose among different investment options. Following information is available for the three stock and you have to choose the two from the three securities to construct a portfolio.
Required:Calculate required rate of return for three stock using SML Equation,if risk free rate of return is 10%.Calculate Fair value of three stocks using Gordon Growth Model.Based on fair price calculation, identify whether the stocks are undervalued or overvalued, justify your answer with reasoning.Considering the above calculations,if you want to construct the portfolio of two stock from the above mentioned three stock., which two stocks you will add in your portfolio and why?NOTE: Formula and complete working is mandatory in each part, provide complete calculations in order to avoid marks deduction.IMPORTANT NOTE: 24 hours extra / grace period after the due date is usually available to overcome uploading difficulties. This extra time should only be used to meet the emergencies and above mentioned due dates should always be treated as final to avoid any inconvenience.
IMPORTANT INSTRUCTIONS/ SOLUTION GUIDELINES/ SPECIAL INSTRUCTIONS DEADLINE:• Make sure to upload the solution file before the due date on VULMS• Any submission made via email after the due date will not be accepted FORMATTING GUIDELINES:• Use the font style “Times NewRoman” or “Arial” and font size “12” • It is advised to compose your document in MS-Word format • You may also compose your assignment in Open Office format • Use black and blue font coloronly RULES FOR MARKING Please note that your assignment will not be graded or graded as Zero (0), if:• It is submitted after the due date.• The file you uploaded does not open or is corrupt.• It is in any format other than MS-Word or Open Office; e.g. Excel, PowerPoint, PDF etc. • Not submitted as per given format • It is cheated or copied from other students, internet, books, journals etc. Note related to load shedding:Dear students, As you know that semester activities have started and load shedding problem is also prevailing in our country. Keeping in view the fact, you all are advised to post your activities as early as possible without waiting for the due date. For your convenience; activity schedule has already been uploaded on VULMS for the current semester, therefore no excuse will be entertained after due date of assignments or GDBs. Best of Luck!!
Answer 1
Required rate of Return of Stock A
r A = r RF + (r M – r RF ) β A
= 10% + (12% - 10%) 0.5
= 11%
Required rate of Return of Stock B
r B = r RF + (r M – r RF ) β B
= 10% + (13% - 10%) 1.5
= 14.5%
Required rate of Return of Stock C
r c = r RF + (r M – r RF ) β C
= 10% + (12.5%-10%) 1
= 12.5%
Answer 2
Fair Price of Stock A
Po* = DIV1 / [(r RF + (r M – r RF) A) - g]
= 5/ [(10% + (12%-10%) 0.5)-4%]
5/7%=R s 71.43
Fair Price of Stock B
Po* = DIV1 / [(r RF + (r M – r RF) B) - g]
= 3/ [(10% + (13% - 10%) 1.5) – 6%
= 3/ 8.5%= R s 35.29
Fair Price of Stock C
Po* = DIV1 / [(r RF + (r M – r RF) C) - g]
= 6/ [10% + (12.5%-10%) 1) – 2%
= 6/10.5%= R s.57.14
Answer 3
Stock A is Undervalued as the fair price is more than the market price.
Stock B is Overvalued as the fair price is less than market price.
Stock C is Undervalued as the fair price is more than the market price.
Answer 4
The Stock A and Stock C should be used to construct the portfolio because of two reasons as the beta of Stock A and Stock C is less than Stock B. The required rate of return of Stock A is less than its market rate of return and required rate of return of Stock C is equal to its market rate of return while the required rate of return of Stock B is more than its market rate of return.
What is the start age of girls average?
Re: MGT201 Assignment 1 Solution and Discussion
Assignment #01Marks =20
Risk, Return and Investment Decisions Investment decisions are supported by various factors including investor choice of risk appetite, return on investment and most important the market situation that is backed by supply and demand forces. The supply and demand impact is reflected in the market price of securities and guide investors to take a rational decision.Along with market forces, company specific information is also helpful in determining the fair price of an investment. Rational investor s consider both market and company specific information to choose among different investment options. Following information is available for the three stock and you have to choose the two from the three securities to construct a portfolio.
Required:Calculate required rate of return for three stock using SML Equation,if risk free rate of return is 10%.Calculate Fair value of three stocks using Gordon Growth Model.Based on fair price calculation, identify whether the stocks are undervalued or overvalued, justify your answer with reasoning.Considering the above calculations,if you want to construct the portfolio of two stock from the above mentioned three stock., which two stocks you will add in your portfolio and why?NOTE: Formula and complete working is mandatory in each part, provide complete calculations in order to avoid marks deduction.IMPORTANT NOTE: 24 hours extra / grace period after the due date is usually available to overcome uploading difficulties. This extra time should only be used to meet the emergencies and above mentioned due dates should always be treated as final to avoid any inconvenience.
IMPORTANT INSTRUCTIONS/ SOLUTION GUIDELINES/ SPECIAL INSTRUCTIONS DEADLINE:• Make sure to upload the solution file before the due date on VULMS• Any submission made via email after the due date will not be accepted FORMATTING GUIDELINES:• Use the font style “Times NewRoman” or “Arial” and font size “12” • It is advised to compose your document in MS-Word format • You may also compose your assignment in Open Office format • Use black and blue font coloronly RULES FOR MARKING Please note that your assignment will not be graded or graded as Zero (0), if:• It is submitted after the due date.• The file you uploaded does not open or is corrupt.• It is in any format other than MS-Word or Open Office; e.g. Excel, PowerPoint, PDF etc. • Not submitted as per given format • It is cheated or copied from other students, internet, books, journals etc. Note related to load shedding:Dear students, As you know that semester activities have started and load shedding problem is also prevailing in our country. Keeping in view the fact, you all are advised to post your activities as early as possible without waiting for the due date. For your convenience; activity schedule has already been uploaded on VULMS for the current semester, therefore no excuse will be entertained after due date of assignments or GDBs. Best of Luck!!