Professional Documents
Culture Documents
Ebookfiles - 920download Full Introduction To Programming With C 3Rd Edition Liang Test Bank Online PDF All Chapter
Ebookfiles - 920download Full Introduction To Programming With C 3Rd Edition Liang Test Bank Online PDF All Chapter
Ebookfiles - 920download Full Introduction To Programming With C 3Rd Edition Liang Test Bank Online PDF All Chapter
https://testbankdeal.com/product/introduction-to-c-programming-
and-data-structures-4th-edition-liang-solutions-manual/
https://testbankdeal.com/product/introduction-to-programming-
with-c-4th-edition-diane-zak-test-bank/
https://testbankdeal.com/product/introduction-to-programming-
with-c-4th-edition-diane-zak-solutions-manual/
https://testbankdeal.com/product/introduction-to-java-
programming-comprehensive-version-10th-edition-liang-test-bank/
Introduction to Java Programming Comprehensive Version
9th Edition Liang Test Bank
https://testbankdeal.com/product/introduction-to-java-
programming-comprehensive-version-9th-edition-liang-test-bank/
https://testbankdeal.com/product/introduction-to-java-
programming-brief-version-10th-edition-liang-test-bank/
https://testbankdeal.com/product/introduction-to-java-
programming-comprehensive-version-10th-edition-liang-solutions-
manual/
https://testbankdeal.com/product/introduct-programmi-c-
international-3rd-edition-liang-test-bank/
https://testbankdeal.com/product/introduction-to-programming-
with-java-2nd-edition-dean-solutions-manual/
Name:_______________________ CSCI 2490 C++ Programming
Armstrong Atlantic State University
(50 minutes) Instructor: Dr. Y. Daniel Liang
1
12 quizzes for Chapter 7
1 If you declare an array double list[] = {3.4, 2.0, 3.5, 5.5}, list[1] is ________.
A. 3.4
B. undefined
C. 2.0
D. 5.5
E. 3.4
2 Are the following two declarations the same
A. no
B. yes
3 Given the following two arrays:
1
A. yes
B. no
6 Suppose char city[7] = "Dallas"; what is the output of the following statement?
A. Dallas0
B. nothing printed
C. D
D. Dallas
7 Which of the following is incorrect?
A. int a(2);
B. int a[];
C. int a = new int[2];
D. int a() = new int[2];
E. int a[2];
8 Analyze the following code:
#include <iostream>
using namespace std;
int main()
{
int list[] = {1, 2, 3, 4, 5};
int newList[5];
reverse(list, 5, newList);
for (int i = 0; i < 5; i++)
cout << newList[i] << " ";
}
#include <iostream>
using namespace std;
2
int main()
{
int x[] = {120, 200, 16};
for (int i = 0; i < 3; i++)
cout << x[i] << " ";
}
A. 200 120 16
B. 16 120 200
C. 120 200 16
D. 16 200 120
10 Which of the following statements is valid?
A. int i(30);
B. int i[4] = {3, 4, 3, 2};
C. int i[] = {3, 4, 3, 2};
D. double d[30];
E. int[] i = {3, 4, 3, 2};
11 Which of the following statements are true?
A. 5
B. 6
C. 0
D. 4
#include <iostream>
using namespace std;
3
int main()
{
int matrix[4][4] =
{{1, 2, 3, 4},
{4, 5, 6, 7},
{8, 9, 10, 11},
{12, 13, 14, 15}};
int sum = 0;
return 0;
}
A. 3 6 10 14
B. 1 3 8 12
C. 1 2 3 4
D. 4 5 6 7
E. 2 5 9 13
15
Which of the following statements are correct?
a. (2 pts)
#include <iostream>
using namespace std;
int main()
{
int a[] = {1, 2};
swap(a[0], a[1]);
cout << "a[0] = " << a[0] << " a[1] = " << a[1] << endl;
return 0;
}
4
b. (2 pts)
#include <iostream>
using namespace std;
int main()
{
int a[] = {1, 2};
swap(a);
cout << "a[0] = " << a[0] << " a[1] = " << a[1] << endl;
return 0;
}
c. (4 pts) Given the following program, show the values of the array
in the following figure:
#include <iostream>
using namespace std;
int main()
{
int values[5];
for (int i = 1; i < 5; i++)
{
values[i] = i;
}
return 0;
}
5
After the last statement
After the array is After the first iteration After the loop is in the main method is
created in the loop is done completed executed
0 0 0 0
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
Part III:
Part III:
<Output>
<End Output>
6
Write a test program that reads a C-string and displays the number of
letters in the string. Here is a sample run of the program:
<Output>
7
Another random document with
no related content on Scribd:
Pemberton slowly answered:
“I don’t know what to think. There is no reason for my doubting
the truth of their death miles above the earth. I have gone over it all
hundreds of times, yet I can not make up my mind whether far above
float the remains of two of the bravest men, or whether far away on
the earth’s surface are two of the slickest rascals that ever lived. Did
what Dexter described really happen or did they fly above out of our
sight and concoct the story? Did they cast down an oxygen tank,
smear blood on a piece of plane that they might have taken with
them for the purpose, and cast it down to fool us? A small cut on a
finger might have furnished the blood, and they might have cast
down part of the stolen money. Why did only one dollar bills come
down? Where are the half-million dollars of large bills? They could
be floating far above with the wrecked plane. Where is the upward
whirlwind? Still, it might have moved or died out. We might have
listened to one of the most awful death struggles, or we might have
been the victims of one of the cleverest jokes ever played on the
public. And the men escaped with half a million dollars. Who knows?
THE END
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the terms
of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth in
paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.