CSC 340.03+.04 ASSIGNMENT 01 to 5 solutions

$30.00

Original Work ?

Download Details:

  • Name: CSC340Asmts-mfm1jn.zip
  • Type: zip
  • Size: 18.82 MB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

CSC 340.03+.04 ASSIGNMENT 01

PART A – Communication, 5 points

1. iLearn a. Log in iLearn. b. In “ASMT 1 Discussions” forum, please reply to the post “Welcome to CSC 340.03 and CSC 340.04” c. Take a screenshot of your reply. d. Include the screenshot in your assignment report.

2. Emailing To answer A.2 questions, you may write: YES. This is to confirm that I … a. Please write a statement here to confirm that you will use your SFSU email address (@mail.sfsu.edu) when contacting your grader and your course instructor so that your emails will not be filtered. Thank you. b. Please write a statement here to confirm that when contacting your course instructor, you will start your email subject with this format: “CSC 340.03 TIC ” or “CSC 340.04 TAC ” so that you will get an answer timely. Thank you. P E R F O R M A N C E T R A C K E R ASMT GRADE YOUR GRADE ZOOM 05 01 15 TOTAL 20 A: 90-100% B: 80-89% C: 70-79% D: 60-69% F: 0-60% The course grader provides feedback to your assignments on iLearn.

c. Please confirm that if you do not get an answer within 24 hours, you will check if you sent your email properly. And in either case, you will kindly resend your email message. Thank you.

3. Grader We have one grader for each section of our class who grades our assignments. Questions regarding assignments and assignment grades should be directed to the grader for your section. a. What is the URL of your grader’s forum on iLearn? b. What is your grader’s full name? c. What is your grader’s SFSU email address? Please email your grader when you have questions.

4. Guidelines for All Assignment, Assignment Report Template, and all future guidelines To answer A.4, you may write: YES. This is to confirm that I have carefully read, understood, and agreed to the Guidelines for ALL Assignments above and the Assignment Report Template. I will also carefully read, understood, and agree to any additional guidelines which the instructor and the grader(s) will provide. I will strictly follow all the instructions.

Please write a statement here to confirm that you have carefully read, understood, and agreed to the Guidelines for ALL Assignments above, the Assignment Report Template, and any future guidelines. If you have any questions, please list all of them here then please email the course grader or the course instructor before the 2nd week of the semester to get an answer. Thank you.

5. Course Policy on Student Conduct and Academic Honesty To answer A.5, please write exactly: YES. This is to confirm that I have carefully read, understood, and agreed to the Course Policy on Student Conduct and Academic Honesty which was distributed to me with the course syllabus and whose digital copy was shared with me on the File Manager. I am acutely aware that the policy includes, but is not limited to, the San Francisco State University’s Code of Student Conduct (at https://conduct.sfsu.edu/standards), the Computer Science Department’s Student Policies (at https://cs.sfsu.edu/student-policies), and the Honor Code of this course (at https://csc340.ducta.net/00-README-StudentConduct_AcademicHonesty.pdf).

I will strictly follow all the rules. Please write a statement here to confirm that you have carefully read, understood, and agreed to the Course Policy on Student Conduct and Academic Honesty which was distributed with the course syllabus and whose digital copy was shared on the File Manager. You are acutely aware that the policy includes, but is not limited to, the San Francisco State University’s Code of Student Conduct (at https://conduct.sfsu.edu/standards), The Computer Science Department’s Student Policies (at https://cs.sfsu.edu/student-policies), and the Honor Code of this course (at https://csc340.ducta.net/00-README-StudentConduct_AcademicHonesty.pdf).

You will honor and strictly follow all the rules. If you have any questions, please list all of them here then please email the course grader or the course instructor before the 2nd week of the semester to get an answer. Thank you.

PART B – File Manager, 2 points

1. Directory “JAVA-TransferableKnowledge” a. Log in to the CSC 340 File Manager. b. Locate the directory “JAVA-TransferableKnowledge” and check it out. c. Include a screenshot of this page in your report.

2. Directory “CPP-Reference” a. Log in to the CSC 340 File Manager. b. Locate the directory “CPP-Reference” and check it out. c. Include a screenshot of this page in your report.

PART C – C++ IDE Installation, 4 points

*** The default IDE for our course is Microsoft Visual Studio Community, the latest version. Windows Users: 1. Install the latest Community (Free) version of Microsoft Visual Studio: – Article: Install C++ support in Visual Studio – URL: https://docs.microsoft.com/en-us/cpp/build/vscpp-step-0-installation

2. Write the “Hello World” program: – Article: Create a C++ console app project – URL: https://docs.microsoft.com/en-us/cpp/build/vscpp-step-1-create

3. Take screenshots of your newly installed Microsoft Visual Studio IDE. The screenshots should show both the code and the output of your “Hello World” program.

4. Include your program in your assignment submission. macOS and Linux Users: ▪ If we have no access to a Windows operating system, it is ok to do this part, Part C, of this assignment using CLion. We can also use an editor such as Visual Studio Code or Xcode with a C++ compiler. ▪ If we are not using the course’s default IDE to do any assignments, please go on iLearn and ask our graders before we start our assignments if your graders are OK with it. Thank you.

PART D – JAVA Refreshment, 4 points

a. Please change the name of a favorite Java program you wrote to “MyFavoriteApp.java” and run it. b. Take screenshots of your Java IDE windows. The screenshots should show both code and output. c. In half a page or more, outline how you would improve your program.

d. Include your program in your assignment submission. e. If you need assistance with Java or Java IDE, please use the resources posted on the File Manager and in the directory File Manager/WEEK-01

CSC 340.03+.04 ASSIGNMENT 02

ABOUT

CSC 220 is among CSC 340’s course prerequisites. CSC 210 and CSC 220 learn Java. Java is used in CSC 413 and other upperdivision courses. A good foundation in Java usually helps us pick up C++ faster. For these reasons, we were supposed to have a
prerequisite exam to demonstrate our comprehensive knowledge of Java programming.

Instead of a test, this assignment is our opportunity to review (and to learn) important Java topics and get us ready for C++.
This assignment is to be done in JAVA, not in C++.
Please start this assignment as soon as possible. We want to make sure that we understand the problems and that we solve
the right problems.

PART A – OOP Class Design Guidelines, 15 points

Y. Daniel Liang’s 8 Class Design Guidelines: https://csc340.ducta.net/WEEK-01/JAVAtoCPP-ClassDesignGuidelines.pdf
Please choose 5 guidelines and discuss them in-depth. For each guideline, use at least one page for your discussion. It is
OK to use code to help demonstrate your points. The code portion, if any, should not take up more than 1/3 of each
guideline’s discussion.

PART B – Java Programming, Data Structures, and Data Design, 85 points

We are hired to implement an interactive dictionary. Our dictionary takes input from users and uses the input as a search
key to look up values associated with the key. Requirements:
– Coding: No hard coding, https://en.wikipedia.org/wiki/Hard_coding. Please think about Dynamic and Scalable.

– Data Source: Store the original data in a set of enum objects. Each keyword, each part of speech, and each definition
must be stored in a separate data field. Do not combine them such as storing three parts in one String.
– Data Structure: Use existing data structures or creating new data structures to store our dictionary’s data.
– Data Loading: When our program starts, it loads all the original data from the Data Source into our dictionary’s data
structure. Data Loading must finish before our program starts interacting with users.

– User Interface: A program interface allows users to input search keys. This interface then displays returned results. Our
program searches the dictionary’s data (not the Data Source) for values associated with the search keys.
– Identical Output: Our program’s output must be identical to the complete sample run’s output. The complete sample
output is posted at https://csc340.ducta.net/Assignments/Assignment-02-PartB-CompleteSampleOutput.pdf.

P E R F O R M A N C E T R A C K E R
ASMT GRADE YOUR GRADE
ZOOM 05
01 15
02 100
TOTAL 120
A: 90-100% B: 80-89% C: 70-79% D: 60-69% F: 0-60%
The course grader provides feedback to your
assignments on iLearn.

1. Program Analysis to Program Design, 15 points. Please think about Interviews.
In at least 1 full page, please explain the following in detail:
▪ Your analysis of the provided information and the
provided complete sample output. Please think about
Clients and Sales.

▪ What problem you are solving. Please explain it
clearly then define it concisely. Please think about
Problem Solving and Interviews.

▪ How you store data in enum objects. And why. Please
think about Data Structures and Data Design.
▪ Which data structures you use/create for your
dictionary. And why. Please think about Data Structures
and Data Design.

2. Program Implementation, 70 points.

Please think about Interviews.
▪ Implement your program to meet all the requirements.
▪ In your assignment report, demonstrate your program to your grader/client.
▪ Does your program work properly?
▪ How will you improve your program?
Happy problem-solving and happy coding!

CSC 340.01+.02 ASSIGNMENT 03

PART A – TIC TAC TOE, 5 points

Please implement a basic version of Tic Tac Toe:
1. Function main and function headers are provided. Please implement the functions and do not change the main.
2. Our program must produce identical output:
Assignment-03_PA_Run1.txt and Assignment-03_PA_Run2.txt

PART B – Credit Card Number Validation, 5 points

Credit card numbers follow certain patterns. A credit card number must have between 13
and 16 digits. The starting numbers are: 4 for Visa cards, 5 for MasterCard cards, 37 for
American Express cards, and 6 for Discover cards.
Example: Validating 4 3 8 8 5 7 6 0 1 8 4 0 2 6 2 6

a) Double every second digit from right to left. If doubling of a digit results in
a two-digit number, add the two digits to get a single digit number.
b) Now add all single-digit numbers from Step a:
4 + 4 + 8 + 2 + 3 + 1 + 7 + 8 = 37
c) Add all digits in the odd places from right to left in the card number:
6 + 6 + 0 + 8 + 0 + 7 + 8 + 3 = 38

d) Sum the results from Step b and Step c:
37 + 38 = 75
e) If the result from Step d is divisible by 10, the card number is valid;
otherwise, it is invalid.

Please implement Credit Card Number Validation:
1. Function main is provided. Please implement isvalidcc and other functions
which you may add to the program.
2. Please do not change function main

3. Your program must produce identical output: Assignment-03_PB_Run.pdf
P E R F O R M A N C E T R A C K E R
ASMT GRADE YOUR GRADE
ZOOM 05
01 15
02 100
03 100
TOTAL 220
A: 90-100% B: 80-89% C: 70-79% D: 60-69% F: 0-60%
The course grader provides feedback to your
assignments on iLearn.

PART C – Dictionary 340 C++, 90 points

Our satisfied clients are back to ask us to implement another interactive dictionary. Our dictionary takes input from users
and uses the input as search key to look up values associated with the key. Requirements:
– Coding: No hard coding, https://en.wikipedia.org/wiki/Hard_coding. Please think about Dynamic and Scalable.

– Data Source: A text file, Data.CS.SFSU.txt . Please think about Software Deployment and Usability.
– Data Structure: Use existing data structure(s) or create new data structure(s) to store our dictionary’s data. Each keyword,
each part of speech, and each definition must be stored in a separate data field. Do not combine them such as storing
three parts in one String.

– Data Loading: When our program starts, it loads all the original data from the Data Source into our dictionary’s data
structure. The data source file is opened once and closed once per run. It must be closed as soon as possible. It must be
closed before our program starts interacting with users.

– User Interface: A program interface allows users to input search keys. This interface then displays returned results. Our
program searches the dictionary’s data (not the data source text file) for values associated with the search keys.
– Identical Output: Our program’s output must be identical to the complete sample run’s output: Assignment-03_PC_Run.pdf

1. Program Analysis to Program Design, 10 points. Please think about Interviews.
In at least 1 full page, please focus on the differences/improvements you are making in this C++ version of the
program in comparison to your previous Java version while explaining the following in detail:
▪ Your analysis of the provided information and the
provided complete sample output. Please think about
Clients and Sales.
▪ What problem you are solving. Please explain it
clearly then define it concisely. Please think about

Problem Solving and Interviews.
▪ How you store data from the external text file. And
why. Please think about Data Structures and Data Design.
▪ Which data structures you use/create for your
dictionary. And why. Please think about Data Structures
and Data Design.

2. Program Implementation, 80 points.

Please think about Interviews.
▪ Implement your program to meet all the requirements.
▪ In your assignment report, demonstrate your program to your grader/client.
▪ Does your program work properly?
▪ How will you improve your program?
Happy problem-solving and happy coding!

CSC 340.03+.04 ASSIGNMENT 04

ABOUT

– Please download: https://csc340.ducta.net/Assignments/Assignment-04-Code.zip
– This assignment’s three main topics are:
▪ Linked List which was a topic of CSC 220 or of a previous course not at SFSU. We reviewed and learned Data Structures.

▪ Recursive Function which was also a topic of CSC 220 or of a previous course not at SFSU.
▪ Smart Pointers which we cover in detail in this course.
▪ Assignment 04-Preparation helped us study the C++ versions of Linked List (the Linked Bag) and of Recursive Function. The
focus was on C++ syntax and advanced implementations.
▪ More help and sample code will be provided. Please start this assignment early.
– All parts of this assignment are to be done in C++.

PART A – Linked Bag. 40 points

– Please change only files: LinkedBag340.cpp and Include.h, no other files.
– We are to implement 8 small additional functions and 2 helper functions to the Linked Bag.
– Our programs must produce identical output to the output in the 2 sample runs: Asmt04_Run1.txt and Asmt04_Run2.txt

▪ Our Test 9’s output must also be identical to the sample output excepts the random values.
▪ Our Test 9’s random values in our 2 sample runs’ output must be different.

Descriptions of the 8 functions:
Please ask questions, if any, during the in-class discussions and demos for this assignment.
1. removeSecondNode340 deletes the second node in the Linked Bag. 4 pts
2. addEnd340 inserts the new node at the end of the Linked Bag. 4 pts
3. getCurrentSize340Iterative counts the number of nodes in the Linked Bag iteratively. 4 pts
4. getCurrentSize340Recursive counts the number of nodes in the Linked Bag recursively. Use 1 helper function:
getCurrentSize340RecursiveHelper. 4 pts

5. IMMEDIATE RECURSION: getCurrentSize340RecursiveNoHelper counts the number of nodes in the Linked Bag
recursively. This recursive function does not use any helper functions. 8 pts
6. getFrequencyOf340Recursive recursively counts the number of times an entry appears in the Linked Bag. Use 1 helper
function: getFrequencyOf340RecursiveHelper. 4 pts

7. IMMEDIATE RECURSION: getFrequencyOf340RecursiveNoHelper recursively counts the number of times an entry
appears in the Linked Bag. This recursive function does not use any helper functions. 8 pts
8. removeRandom340 removes a random entry from the Linked Bag. 4 pts

P E R F O R M A N C E T R A C K E R
ASMT GRADE YOUR GRADE
ZOOM 05
01 15
02 100
03 100
MIDTERM 01 25
04-PREPARATION 25
04 75
TOTAL 345
A: 90-100% B: 80-89% C: 70-79% D: 60-69% F: 0-60%
The course grader provides feedback to your assignments
on iLearn.

PART B – Smart Pointers. 15 points

– For each of the following statements, please:
▪ Explain the statement in 5 or more sentences. Please think Interviews. And
▪ Create a new code experiment to demonstrate our understanding.
▪ Please remember to submit our code and document our experiment in our assignment report.

1. Deleting the same memory twice: This error can happen when two pointers address the same dynamically allocated object.
If delete is applied to one of the pointers, then the object’s memory is returned to the Free store. If we subsequently
delete the second pointer, then the Free-store may be corrupted.

2. Use smart pointers… Objects that must be allocated with new, but you like to have the same lifetime as other
objects/variables on the Run-time stack. Objects assigned to smart pointers will be deleted when program exits that
function or block.

3. Use smart pointers… Data members of classes, so when an object is deleted all the owned data is deleted as well (without
any special code in the destructor).

4. Converting unique_ptr to shared_ptr is easy. Use unique_ptr first and covert unique_ptr to shared_ptr when
needed.
5. Use weak_ptr for shared_ptr like pointers that can dangle.

PART C – Linked Bag, Smart Pointers Version. 20 points

– Create a Smart Pointers version of our PART A’s Linked Bag:
1. Please create a copy of our entire PART A solution and name it: PartC_SmartPointers.
2. Then go through all the files, not just LinkedBag340.cpp, and use smart pointers properly where it is possible.
3. In our assignment report, list the file names and the line numbers in which we use smart pointers. For each smart pointer,
explain in 5 or more sentences why it is a proper use.

4. This Smart Pointers version must work properly and produce identical output like that of our PART A version.
5. In addition, please update and add destructor(s) so that the program displays more information (in addition to the output
required and described above) when object(s) get destroyed.
6. Please remember to submit our code of this part. Save the code under a folder named “PartC_SmartPointers” and
include this folder in the assignment submission ZIP. Please remember to document this part in the assignment report.

PART D – Linked Bag, Creativity. 5 Extra Credit points

– Please create a copy of our entire PART C solution and name it: PartD_IamCreative
– This part is to show off our creative mind. Please implement a new function for Part C’s LinkedBag. We need to add code to
LinkedBag340.cpp and Include.h and write PartD.cpp to demonstrate how this new function works.

– Requirements, this function shall:
1. Perform one meaningful task. Please use the first paragraph of at least 5 sentences in PART D to explain why it is a
meaningful task.
2. Modify the LinkedBag’s content every time it runs.
3. Use Smart Pointers in its parameter list, in its implementation, and as return value(s).
– Our graders expect higher quality in this part: creativity, a meaningful task, clean code, and clear documentation and report.
Happy coding and thank you!

CSC 340.01+.02 ASSIGNMENT 05

ABOUT

This assignment gives us more practice with sorting algorithms.
– We are reviewing and learning 6 sorting algorithms. Detailed instructions, illustrations, code, and samples are
provided in class. Please refer to the “Sorting” package and the lecture slides.
– The lecture slides: https://csc340.ducta.net/WEEK-15/index.php
– Let us aim to complete this assignment on time so that we will get it graded hopefully before our final exams. This
material will be useful for our reviews.

– This assignment is our last assignment for this semester. Congratulations and Thank you!

INSTRUCTION – Sorting, 30 points

Please come up with an array of 9 random integers then sort the array in 5 different ways. Show the contents of the array
each time a sorting algorithm changes it while sorting the array into ascending order. The 6 sorting algorithms we are using
are:
1. Selection Sort 3 points
2. Insertion Sort 3 points
3. Shell Sort 7 points
4. Bubble Sort 3 point
5. Merge Sort 7 points
6. Quick Sort 7 points

It is OK to do this assignment on paper then organize the snapshots of our work in our assignment report. (Adobe Scan,
Google Lens, and Office Lens are good apps, which I know, for scanning documents. Please recommend yours. Thank you.)

Coding is highly recommended but not required. Please submit a single PDF file, the assignment report.
We have been trying to wrap up the semester as soon as possible so that we can do well on our final exam and find more time
for other courses. Let us find time to complete this assignment as soon as possible despite that I set it to be due on 05/07.

I am teaching one three CSC 340 sections this summer and this fall. I welcome all of us to attend the sections without
enrollment (FREE) if we are interested in reviewing the materials. See you. And thank you! Best. Duc
P E R F O R M A N C E T R A C K E R
ASMT GRADE YOUR GRADE
ZOOM 05
01 15
02 100
03 100
MIDTERM 01 25
04-PREPARATION 25
04 75
MIDTERM 02 25
05 30
TOTAL 400
A: 90-100% B: 80-89% C: 70-79% D: 60-69% F: 0-60%
The course grader provides feedback to your assignments on iLearn.