Description
All the instruction are in the file names instructions. The main.cpp files and other needed code files are inside the code file. If any questions, please ask.
Unformatted Attachment Preview
CSCE 221 Cover Page
Programming Assignment #1
Due July 10th by midnight to eCampus
First Name
Last Name
UIN
June 11, 2018
User Name
address
E-mail
Please list all sources in the table below including web pages which you used to solve or implement the current
homework. If you fail to cite sources you can get a lower number of points or even zero, read more: Aggie Honor
System Office
Type of sources
People
Web pages (provide URL)
Printed material
Other Sources
I certify that I have listed all the sources that I used to develop the solutions/codes to the submitted
work.
“On my honor as an Aggie, I have neither given nor received any unauthorized help on this academic
work.”
Your Name
Date
1
Programming Assignment 1 (130 points)
In the first phase of the assignment, implement in C++ a class My_vec that can hold data of character type (char).
The description of the functions for data manipulation is provided in the first set of the lecture notes, see the slide
8. In the second phase, write a generic version of the class My_vec that can handle any type of data.
Instructions:
1. Download the supplementary file with a sample code from the class webpage.
2. Your files should be arranged as follows
(a) Declaration of My_vec class in My_vec.h
(b) Definition (implementation) of My_vec class in My_vec.cpp
(c) Testing code in Main.cpp
(d) Use Makefile by calling make
3. Compile your program using the Linux machine command line:
g++ -std=c++11 *.cpp
or
make all
4. Run your program by executing
./Main
5. Be sure to increase or decrease allocated memory when you insert to or remove from a vector.
6. Be sure to check the vector size against its capacity. If its size is greater than its capacity then allocate more
memory by doubling the current capacity and copying the content of the vector.
Points Distribution for Assignment (for part 1 and 2)
1. My_vec class member functions:
(a) (4 pt) elem_at_rank
(b) (8 pt) insert_at_rank
i.
ii.
iii.
iv.
v.
(4 pt) replace_at_rank
(8 pt) remove_at_rank
(8 pt) constructors and copy constructor
(12 pt) destructor, the assignment operator
(6 pt) overloading the bracket [] operator
(c) non-member functions:
i. (6 pt) overloading
Purchase answer to see full attachment
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Explanation & Answer
Attached.
I modified the existing My_vec class. In orde...
Completion Status:
100%
Review
Review
Anonymous
Excellent resource! Really helped me get the gist of things.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Most Popular Content
4 pages
Data Structures And Problem Solving.edited
The week's challenge activities involved implementing graphs with dynamic adjacency lists. Graphs are data structures that ...
Data Structures And Problem Solving.edited
The week's challenge activities involved implementing graphs with dynamic adjacency lists. Graphs are data structures that are used to explain ...
Run Solver Excel Equation model HW5
http://secs.ac.in/wp-content/CSE_PORTAL/DataMining... 1. (Chapter 7 in Edition 4 - Question 36)
Add a new stock, stock 4, ...
Run Solver Excel Equation model HW5
http://secs.ac.in/wp-content/CSE_PORTAL/DataMining... 1. (Chapter 7 in Edition 4 - Question 36)
Add a new stock, stock 4, to the model in Example 7.9. Assume that the estimated mean and
standard deviation of return for stock 4 are 0.125 and 0.175, respectively. Also, assume the
correlations between stock 4 and the original 3 stocks are 0.3, 0.5, and 0.8. Run Solver on
the modified model, where the required expected portfolio return is again 0.12. Is stock in the
optimal portfolio? Then run SolverTable as in the example. Is stock 4 in any of the optimal
portfolios on the efficient frontier? 2. (Chapter 7 in Edition 4 - Question 54)
A company manufactures two products. If it charges price pi for product i, it can sell qi units
of product i, where q1 = 60 − 3p1 + p2 and q2 = 80 − 2p2 + p1. It costs $5 to produce a unit of
product 1 and $12 to produce a unit of product 2. How many units of each product should the
company produce, and what prices should it charge, to maximize its profit? 3. (Chapter 8 in Edition 4 - Question 15: Classification)
Review Section 8.8 on Clustering Analysis.
The file P08-15.xlsx contains the following information about the top 25 MBA programs (according
to the 1997 Business Week Guide): percentage of applicants accepted, percentage of
accepted applicants who enroll, mean GMAT score of enrollees, mean undergraduate GPA of
enrollees, annual cost of school (for state schools, this is the cost for out-of-state students),
1
percentage of students who are minorities, percentage of students who are non-U.S. residents,
and mean starting salary of graduates (in thousands of dollars). Use these data to divide the
top 25 schools into 4 clusters using the clustering approach in Section 8.8. Then interpret your
clusters.
ENTD 380 American Military University PassValue and ReturnValue Project
Instructions:* Make sure you go to this week's chapter lesson for more guidance. For this assignment, you will write two ...
ENTD 380 American Military University PassValue and ReturnValue Project
Instructions:* Make sure you go to this week's chapter lesson for more guidance. For this assignment, you will write two different methods. In one method you will pass a value to the method and in the other method you will return a value from the method. Name your methods PassValue and ReturnValue.Save the code in jGRASP, then save it in c:\myjava and run it./******************* Name: Date: Notes: *******************/public class PassValue{ public static void main(String[] args) { add content and comments } public static void sub(String) { add content and comments }}/******************* Name: Date: Notes: *******************/public class ReturnValue{ public static void main(String[] args) { add content and comments } public static void sub(String) { add content and comments }}Make sure that you include all source codes and the compiled codes into W3_firstname_lastname.zip.You must leave me a note in the Submitted Text area on how to compile and run your code.RequirementsPoints AvailableAssignment details in a comment block (flowerbox)10Core application as described in the assignment requirement60Print function used to correctly to print the solution to the assignment20Code is commented and application name is submitted as requested10Total100
SDEV 300 University of Maryland Wk 1 Create a Pylint Code Computer Coding Task
Week 1 Deliverables
Overview: In this week, you have set-up your Python Environment. The Lab for this week demonstrates
...
SDEV 300 University of Maryland Wk 1 Create a Pylint Code Computer Coding Task
Week 1 Deliverables
Overview: In this week, you have set-up your Python Environment. The Lab for this week demonstrates
your first use of this environment with a fairly simple Python application. You will also use pylint to
verify your code is using professional coding style and standards.
Submission requirements include 3 files. (Zipping them into one file is acceptable):
Python Voter Registration Application Code (python code)
Word or PDF file containing your test and pylint results
Python Applications for Lab1: (total 100 points):
This lab consists of two parts. The first exercise produces a voter registration application asking the user
a few simple questions followed by a confirmation of registration, provided the user is eligible. The
second part documents your testing and pylint analysis results.
1. Using your Python programming environment, write a Python application that supports voter
registration. The application will launch and run from the command line prompt. The application will
prompt the user for their first name, last name, age, country of citizenship, state of residence and
zipcode. To be a valid registration all fields must be entered. If they are at least 18 years old and a U.S
citizen, they can move forward and be prompted for the remaining questions and register to vote. If not,
they should not be presented with the additional questions. There should be some error checking logic
on the input statements to make sure the age numbers entered seem reasonable (e.g. a person is
probably not > 120 years) and states should be 2 letters representing only valid U.S. States. The
application should prompt the user for the needed questions to complete the registration and reprompt when data is invalid giving the user the opportunity to retry. The output should summarize the
input data and congratulate the user if they are eligible to vote and entered all of the data. The user
should be given options to exit the program at any time to cancel the registration process.
The following is a possible application interface. Other application interfaces are possible as well. (80
points)
****************************************************************
Welcome to the Python Voter Registration Application.
Do you want to continue with Voter Registration?
Yes.
What is your first name?
Sally
Do you want to continue with the voter Registration?
What is your last name?
Smith
Do you want to continue with the voter Registration?
Yes
What is your age?
49
Do you want to continue with the voter Registration?
2
Yes
Are you a U.S. Citizen?
Yes
Do you want to continue with the voter Registration?
Yes
What state do you live?
MD
Do you want to continue with the voter Registration?
Yes
What is your zipcode?
21012
Thanks for registering to vote. Here is the information we
received:
Name (first last): Sally Smith
Age: 49
U.S. Citizen: Yes
State: MD
Zipcode: 21012
Thanks for trying the Voter Registration Application. Your voter
registration card should be shipped within 3 weeks.
****************************************************************
Hints:
1. Be sure to add logic to test for continuing the registration process.
2. Validate data is valid on entry (e.g. all fields have input data, age seems correct, states seem
correct.)
3. Test with many combinations. For example, what happens if you enter invalid data? Exit the
application at any point, or aren’t 18 years old?
4. Use comments to document your code
5. Use pylint to verify the code style – the goal is a 10!
2. Document your test results for each application within your programming environment. You should
also include and discuss your pylint results for each application. The test document should include a test
table that includes the input values, the expected results and the actual results. A screen capture should
be included that shows the actual test results of running each test case found in the test table. Be sure
to include multiple test cases to provide full coverage for all code. For example, you should demonstrate
each set of logic in the code works as expected and every statement in the code is reached through the
test cases. (20 points)
A possible test table may look like this:
Test
Case
Input Expected Output Actual Output Pass?
1a 1,2,3,4,5,6,7,8,9,10 Sum= 54,
Range =9
Sum= 54,
Range =9
Yes
1b 2,10,1,11,11,32,42,21,32,23 Sum= 183,
Range =41
Sum= 183,
Range =41
Yes
3
1c 3,g,e,s,7,12,e,s,x,! Error Error No input
validation issue
…
Include the screen captures support each of the test cases. These are the screen captures validating the
actual output for each test case.
Any submissions that do not represent work originating from the student will be submitted to the
Dean’s office and evaluated for possible academic integrity violations and sanctions.
Capturing Trace Route Packets
I have two lab about to use Wireshark to capture Trace Route packets. First lab: Use the Trace Route program to see the ro ...
Capturing Trace Route Packets
I have two lab about to use Wireshark to capture Trace Route packets. First lab: Use the Trace Route program to see the routers packets must travel
through to get from your computer to a destination on the Internet. Second lab: Use packet information captured with Wireshark to determine whether
your computer is attached to the rest of the classroom with a hub or switch with 4 question need to answer.
Similar Content
use matlab to solve
Hi, you should be able to find all the information you need within the doc, please you matlab to solve the questionswhile ...
MISM 6213 University of California Programming & Final Data Sets Discussion
Please upload your milestone 2 as a Word document. Each team can submit 1 file for all team members (i.e., 1 per team).If ...
Programming code
I need a code to convert decimal number to binary number....
UOG Standard Deviation Questions
Portfolio Management and Security Analysis
Course Pack
1
Reading
The recommended textbook for this class is:
Elton, E....
CIT 237 Valencia College C++ Short Program on Arrays Worksheet
CIT-237
Lab 7.1
Arrays
The goal of this lab is to help you get familiar with arrays.
Due Date
You must demonstrate the...
New York University Java Worksheet
Write a JAVA program using user-defined method(s) that displays the first 50 prime numbers in five lines, each of which co...
Softwares And Clients
1.1 The program shall enable customers to make an in-store order. 1.2 The program shall enable customers to place a teleph...
Soln
train_x = pd.read_csv("trainx.csv",header = None) train_y = pd.read_csv("trainy.csv",header = None) test_x = pd.read_csv("...
Doc 1
In this research, we will look at the concept of globalization and what it means in the world of business. Also, it explai...
Related Tags
Book Guides
Shattered - Inside Hillary Clintons Doomed Campaign
by Amie Parnes and Jonathan Allen
The Outsiders
by S.E. Hinton
Beowulf
by Anonymous Anglo-Saxon poet
The English Patient
by Michael Ondaatje
Dandelion Wine
by Ray Bradbury
A Separate Peace
by John Knowles
Ezperanza Rising
by Pam Muñoz Ryan
The Chosen
by Chaim Potok
Mrs Dalloway
by Virginia Woolf
Get 24/7
Homework help
Our tutors provide high quality explanations & answers.
Post question
Most Popular Content
4 pages
Data Structures And Problem Solving.edited
The week's challenge activities involved implementing graphs with dynamic adjacency lists. Graphs are data structures that ...
Data Structures And Problem Solving.edited
The week's challenge activities involved implementing graphs with dynamic adjacency lists. Graphs are data structures that are used to explain ...
Run Solver Excel Equation model HW5
http://secs.ac.in/wp-content/CSE_PORTAL/DataMining... 1. (Chapter 7 in Edition 4 - Question 36)
Add a new stock, stock 4, ...
Run Solver Excel Equation model HW5
http://secs.ac.in/wp-content/CSE_PORTAL/DataMining... 1. (Chapter 7 in Edition 4 - Question 36)
Add a new stock, stock 4, to the model in Example 7.9. Assume that the estimated mean and
standard deviation of return for stock 4 are 0.125 and 0.175, respectively. Also, assume the
correlations between stock 4 and the original 3 stocks are 0.3, 0.5, and 0.8. Run Solver on
the modified model, where the required expected portfolio return is again 0.12. Is stock in the
optimal portfolio? Then run SolverTable as in the example. Is stock 4 in any of the optimal
portfolios on the efficient frontier? 2. (Chapter 7 in Edition 4 - Question 54)
A company manufactures two products. If it charges price pi for product i, it can sell qi units
of product i, where q1 = 60 − 3p1 + p2 and q2 = 80 − 2p2 + p1. It costs $5 to produce a unit of
product 1 and $12 to produce a unit of product 2. How many units of each product should the
company produce, and what prices should it charge, to maximize its profit? 3. (Chapter 8 in Edition 4 - Question 15: Classification)
Review Section 8.8 on Clustering Analysis.
The file P08-15.xlsx contains the following information about the top 25 MBA programs (according
to the 1997 Business Week Guide): percentage of applicants accepted, percentage of
accepted applicants who enroll, mean GMAT score of enrollees, mean undergraduate GPA of
enrollees, annual cost of school (for state schools, this is the cost for out-of-state students),
1
percentage of students who are minorities, percentage of students who are non-U.S. residents,
and mean starting salary of graduates (in thousands of dollars). Use these data to divide the
top 25 schools into 4 clusters using the clustering approach in Section 8.8. Then interpret your
clusters.
ENTD 380 American Military University PassValue and ReturnValue Project
Instructions:* Make sure you go to this week's chapter lesson for more guidance. For this assignment, you will write two ...
ENTD 380 American Military University PassValue and ReturnValue Project
Instructions:* Make sure you go to this week's chapter lesson for more guidance. For this assignment, you will write two different methods. In one method you will pass a value to the method and in the other method you will return a value from the method. Name your methods PassValue and ReturnValue.Save the code in jGRASP, then save it in c:\myjava and run it./******************* Name: Date: Notes: *******************/public class PassValue{ public static void main(String[] args) { add content and comments } public static void sub(String) { add content and comments }}/******************* Name: Date: Notes: *******************/public class ReturnValue{ public static void main(String[] args) { add content and comments } public static void sub(String) { add content and comments }}Make sure that you include all source codes and the compiled codes into W3_firstname_lastname.zip.You must leave me a note in the Submitted Text area on how to compile and run your code.RequirementsPoints AvailableAssignment details in a comment block (flowerbox)10Core application as described in the assignment requirement60Print function used to correctly to print the solution to the assignment20Code is commented and application name is submitted as requested10Total100
SDEV 300 University of Maryland Wk 1 Create a Pylint Code Computer Coding Task
Week 1 Deliverables
Overview: In this week, you have set-up your Python Environment. The Lab for this week demonstrates
...
SDEV 300 University of Maryland Wk 1 Create a Pylint Code Computer Coding Task
Week 1 Deliverables
Overview: In this week, you have set-up your Python Environment. The Lab for this week demonstrates
your first use of this environment with a fairly simple Python application. You will also use pylint to
verify your code is using professional coding style and standards.
Submission requirements include 3 files. (Zipping them into one file is acceptable):
Python Voter Registration Application Code (python code)
Word or PDF file containing your test and pylint results
Python Applications for Lab1: (total 100 points):
This lab consists of two parts. The first exercise produces a voter registration application asking the user
a few simple questions followed by a confirmation of registration, provided the user is eligible. The
second part documents your testing and pylint analysis results.
1. Using your Python programming environment, write a Python application that supports voter
registration. The application will launch and run from the command line prompt. The application will
prompt the user for their first name, last name, age, country of citizenship, state of residence and
zipcode. To be a valid registration all fields must be entered. If they are at least 18 years old and a U.S
citizen, they can move forward and be prompted for the remaining questions and register to vote. If not,
they should not be presented with the additional questions. There should be some error checking logic
on the input statements to make sure the age numbers entered seem reasonable (e.g. a person is
probably not > 120 years) and states should be 2 letters representing only valid U.S. States. The
application should prompt the user for the needed questions to complete the registration and reprompt when data is invalid giving the user the opportunity to retry. The output should summarize the
input data and congratulate the user if they are eligible to vote and entered all of the data. The user
should be given options to exit the program at any time to cancel the registration process.
The following is a possible application interface. Other application interfaces are possible as well. (80
points)
****************************************************************
Welcome to the Python Voter Registration Application.
Do you want to continue with Voter Registration?
Yes.
What is your first name?
Sally
Do you want to continue with the voter Registration?
What is your last name?
Smith
Do you want to continue with the voter Registration?
Yes
What is your age?
49
Do you want to continue with the voter Registration?
2
Yes
Are you a U.S. Citizen?
Yes
Do you want to continue with the voter Registration?
Yes
What state do you live?
MD
Do you want to continue with the voter Registration?
Yes
What is your zipcode?
21012
Thanks for registering to vote. Here is the information we
received:
Name (first last): Sally Smith
Age: 49
U.S. Citizen: Yes
State: MD
Zipcode: 21012
Thanks for trying the Voter Registration Application. Your voter
registration card should be shipped within 3 weeks.
****************************************************************
Hints:
1. Be sure to add logic to test for continuing the registration process.
2. Validate data is valid on entry (e.g. all fields have input data, age seems correct, states seem
correct.)
3. Test with many combinations. For example, what happens if you enter invalid data? Exit the
application at any point, or aren’t 18 years old?
4. Use comments to document your code
5. Use pylint to verify the code style – the goal is a 10!
2. Document your test results for each application within your programming environment. You should
also include and discuss your pylint results for each application. The test document should include a test
table that includes the input values, the expected results and the actual results. A screen capture should
be included that shows the actual test results of running each test case found in the test table. Be sure
to include multiple test cases to provide full coverage for all code. For example, you should demonstrate
each set of logic in the code works as expected and every statement in the code is reached through the
test cases. (20 points)
A possible test table may look like this:
Test
Case
Input Expected Output Actual Output Pass?
1a 1,2,3,4,5,6,7,8,9,10 Sum= 54,
Range =9
Sum= 54,
Range =9
Yes
1b 2,10,1,11,11,32,42,21,32,23 Sum= 183,
Range =41
Sum= 183,
Range =41
Yes
3
1c 3,g,e,s,7,12,e,s,x,! Error Error No input
validation issue
…
Include the screen captures support each of the test cases. These are the screen captures validating the
actual output for each test case.
Any submissions that do not represent work originating from the student will be submitted to the
Dean’s office and evaluated for possible academic integrity violations and sanctions.
Capturing Trace Route Packets
I have two lab about to use Wireshark to capture Trace Route packets. First lab: Use the Trace Route program to see the ro ...
Capturing Trace Route Packets
I have two lab about to use Wireshark to capture Trace Route packets. First lab: Use the Trace Route program to see the routers packets must travel
through to get from your computer to a destination on the Internet. Second lab: Use packet information captured with Wireshark to determine whether
your computer is attached to the rest of the classroom with a hub or switch with 4 question need to answer.
Earn money selling
your Study Documents