100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Comp Sci 1430 Final Exam End of Chapter Questions With Complete Solutions

Rating
-
Sold
-
Pages
46
Grade
A+
Uploaded on
11-08-2025
Written in
2025/2026

Comp Sci 1430 Final Exam End of Chapter Questions With Complete Solutions












Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
August 11, 2025
Number of pages
46
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Comp Sci 1430 Final Exam End of Chapter Questions With
Complete Solutions

____ files contain data that is unformatted and not necessarily
stored as ascii text Correct Answers binary

____ is the default behavior when an object is assigned the value
of another object of the same class Correct Answers
memberwise assignment

_____ a list means traveling through the list Correct Answers
traversing

_____ are pointer-like objects used to access information stored
in a container Correct Answers iterators

_____ files contain information formatted as ASCII text Correct
Answers text

_____ is a special built-in pointer that is automatically passed as
a hidden argument to all nonstatic member fxns Correct
Answers this

_____ recursion is when function A calls function B, which in
turn calls function A Correct Answers indirect

______ recursion is when a fxn explicitly calls itself Correct
Answers direct

a ____ container organizes data in a sequential fashion similar to
an array Correct Answers sequence

,a ____ fxn is not a member of a class, but has access to the
private members of the class Correct Answers friend

a ____ is represented in memory as an array of characters with a
null terminator Correct Answers c-string

a _____ container uses keys to rapidly access elements Correct
Answers associative

a _____ is written in your program as a sequence of characters
surrounded by double quotes Correct Answers string literal

a ______ is a special constructor, called whenever a new object
is initialized with another object's data Correct Answers copy
constructor

a c-string is an array of characters terminated with the sentinel
value Correct Answers '\0'

a class that cannot be instantiated is called is a Correct Answers
abstract class

a class with at least one pure virtual member function is called a
_____ class Correct Answers abstract

a constructor that takes a single parameter of a type different
from the class type is a ____ constructor Correct Answers
convert

,A data structure that points to an object of the same type as itself
is known as a ______ data structure Correct Answers self
referential

A file filter reads an input file, transforms it in some way, and
writes the results to an output file. Write an abstract file filter
class that defines a pure virtual function for transforming a
character.
Create one subclass of your file filter class that performs
encryption,
another that transforms a file to all uppercase, and another that
creates an unchanged copy of the original file. The class should
have
a member function

void do Filter(ifstream &in, ofstream &out)

that is called to perform the actual filtering. The member
function for transforming a single character should have the
prototype
char transform(char ch)

The encryption class should have a constructor that takes an
integer as an argument and use it as the encryption key

Second part of the question:

Create a subclass of the abstract filter class of programming
challenge 5 (i.e example above) that double spaces a file: that is,
it inserts a blank Correct Answers #include "stdafx.h"
#include <fstream>

, #include <string>
#include <iostream>
using namespace std;

// FileFilter abstract class
class FileFilter
{
private: int key;
public:
FileFilter()
{
}
FileFilter(int key)
{
this->key=key;
}
char transform(char ch)const
{
if(ch>='a' && ch<='z')
return ((ch-'a')+key)%26+'a';

else if(ch>='A' && ch<='Z')
return ((ch-'A')+key)%26+'A';
}
virtual void doFilter(ifstream &in, ofstream &out)const=0;
//pure virtual function
};


//class Encryption
class Encryption : public FileFilter

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Classroom NURSING
View profile
Follow You need to be logged in order to follow users or courses
Sold
4708
Member since
3 year
Number of followers
3219
Documents
52403
Last sold
12 hours ago
NURSING

Assignments, Case Studies, Research, Essay writing service, Questions and Answers, Discussions etc. for students who want to see results twice as fast. I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc, and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules. For every student you refer to me with an order that is completed and paid transparently, I will do one assignment for you, free of charge!!!!!!!!!!!!

Read more Read less
4.0

1166 reviews

5
615
4
213
3
191
2
39
1
108

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions