Question

CSE 110 Introduction to Computer Science 41. An array of size 10, has only nine slots for storing values TRUE FALSE 42. When is the external name of the file used in the program? A. Any time you read or write to the file B. Never C. Only when reading from the file D. When opening the file stream 43. Creating a flow chart when designing a complex algorithm is a waste of time. TRUE 44. Using indentation can make our code much easier to read and debug. 45. Which of the following would be considered a good name for a function that converts FALSE TRUE FALSE temperatures from Fahrenheit to Celsiusi? A. calc B. convert_temp C. temp D. myfunction 46. It is legal to have a function with no arguments TRUE FALSE 47. When you add a value to a pointer, you are actually adding that number times the size of the data type referenced by the pointer. TRUE FALSE 48. You cannot have more than one input and one output stream open at any TRUE FALSE one time. TRUE FALSE 49. The variables (elements) stored in an array must be integers. 50. The String class lets you treat strings like other pre-defined data types. 51. With the string class, this would compare two strings if (strlsr2). 52. To use the string class, you must include the <string> library. 53. A pointer is the memory address of a variable. TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSEplease answer all question

0 0
Add a comment Improve this question Transcribed image text
Answer #1

41. FALSE  

eg: int a[10]

you can store 10 values.

42. d)ONLY WHEN OPENING THE FILE STREAM

eg:

FILE *fp;

fp = fopen("test.txt", "w+"); // we use filename only while opening the file stream

fprintf(fp, "writing..\n") // we use file pointer while writing to a file

fclose(fp);

43. FALSE

Since, flow chart accomodates all possible senarios of the problem and gives you an accurate algorithm. You can also cross check your algorithm with flow chart to uncover any discrepencies. Flow chart is used to design an algorithm.

44. TRUE

Proper spacing can improve code's readability and understandability.

45. convert-temp

your function name should always reflect its purpose. This can avoid a lot of confusion.

46. TRUE

it is perfectly alright to have a function withour any arguments. Such functions always make use of constants for calculation or simply to print something.

47. TRUE

if you have an int pointer *i. it will be referencing to address 1000 (i=1000 say). you increment the pointer by 1. this will add the size of integer to the base address which will give you 1004 ( size of int =4 (say) this can vary compiler to compiler). similarly if you add 2 to i, you are actually referencing address 1008 ( 1000+ (4*2))

48. FALSE

you can have more than one i/o different streams open simultaneously. But the stream( files) should not be same.

49. FALSE

It depends on the data type of the array. if it is an integer array you can store only integer elements. if it is a character array you can store character elements. Java also supports array of strings.

50. TRUE

in java and c++, String class can be used as data type to declare a variable of string type and store strings. In reality String is a class.Its constructor gets invoked when it is used.

51. TRUE

String s1="aaa"

String s2="aaa"

if (s1==s2) will result in TRUE

this is because s1 is created and it points to memory location 1000 which stores value "aaa". on executing 2nd statement s2 is not created instead it is poitning to the same location 1000. therefore it returns true.

This would not be true if s1 and s2 were created using NEW operator.

52. TRUE (C++)

FALSE (JAVA)

in java String class is in java.lang package which is imported by default.

53. TRUE

A pointer variable stores address of a variable.

eg : int *p;

p=&a // address of a is stored in pointer variable p

ALL THE BEST :)

Add a comment
Know the answer?
Add Answer to:
please answer all question CSE 110 Introduction to Computer Science 41. An array of size 10,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Stuck on this computer science assignment Write a program that demonstrates binary searching through an array...

    Stuck on this computer science assignment Write a program that demonstrates binary searching through an array of strings and finding specific values in an corresponding parallel double array. In all cases your output should exactly match the provided solution.o. Provided files: Assignment.cpp - starter assignment with function prototypes companies.txt - file for program to read. earnings.txt - file for program to read. Input1.txt Input2.txt - Test these inputs out manually, or use stream redirection Input3.txt - These inputs are based...

  • **** ITS MULTI-PART QUESTION. PLEASE MAKE SURE TO ANSWER THEM ALL. SOLVE IT BY JAVA. ****...

    **** ITS MULTI-PART QUESTION. PLEASE MAKE SURE TO ANSWER THEM ALL. SOLVE IT BY JAVA. **** *** ALSO MAKE SURE IT PASS THE TESTER FILE PLEASE*** Often when we are running a program, it will have a number of configuration options which tweak its behavior while it's running. Allow text completion? Collect anonymous usage data? These are all options our programs may use. We can store these options in an array and pass it to the program. In its simplest...

  • Lab 19 - History of Computer Science, A File IO Lab FIRST PART OF CODING LAB:...

    Lab 19 - History of Computer Science, A File IO Lab FIRST PART OF CODING LAB: Step 0 - Getting Starting In this program, we have two classes, FileIO.java and FileReader.java. FileIO.java will be our “driver” program or the main program that will bring the file reading and analysis together. FileReader.java will create the methods we use in FileIO.java to simply read in our file. Main in FileIO For this lab, main() is provided for you in FileIO.java and contains...

  • You are going to implement Treesort algorithm in C++ to sort string data. Here are the...

    You are going to implement Treesort algorithm in C++ to sort string data. Here are the steps to complete the homework 1) Use the following class definition for binary search tree nodes. Its constructor is incomplete you should first complete the constructor. class TreeNode t public: string data; / this is the string stored in the node TreeNode left: TreeNode right; TreeNode (string element, TreeNode 1t, TreeNode rt //your code here 2) Write a function that will insert a string...

  • C programming 1) When setting a two-dimensional character array, how is the size (number of characters)...

    C programming 1) When setting a two-dimensional character array, how is the size (number of characters) in the second dimension set? Select an answer: The number of elements are equal to the average size of all the strings. To the length of the longest string; you don't need to add one because the first array element is zero. To the length of the longest string, plus one for the null character. The second dimension is equal to the number of...

  • [C++] Outline: The movie data is read from a file into an array of structs and...

    [C++] Outline: The movie data is read from a file into an array of structs and is sorted using the Selection Sort method and the search is done using the Binary Search algorithm with the year of release as key. This assignment upgrades to an array of pointers to the database elements and converts the Selection Sort and Binary search procedure on the database to selection sort and binary search on the array of pointers to the database.   Requirements: Your...

  • Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names,...

    Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names, and read in course names from an input file. Then do the output to show each course name that was read in. See Chapter 8 section on "C-Strings", and the section "Arrays of Strings and C-strings", which gives an example related to this lab. Declare the array for course names as a 2-D char array: char courseNames[10] [ 50]; -each row will be a...

  • 1. You are given a C file which contains a partially completed program. Follow the instructions...

    1. You are given a C file which contains a partially completed program. Follow the instructions contained in comments and complete the required functions. You will be rewriting four functions from HW03 (initializeStrings, printStrings, encryptStrings, decryptStrings) using only pointer operations instead of using array operations. In addition to this, you will be writing two new functions (printReversedString, isValidPassword). You should not be using any array operations in any of functions for this assignment. You may use only the strlen() function...

  • can you please follow all the instructions ? The answers that I got has either missing...

    can you please follow all the instructions ? The answers that I got has either missing range for loop or one funtion . Read the instructions carefully. At least 10% will be deducted if the instructions are not followed. For general lab requirements, see General Lab Requirements. Do not prompt the user for input during the execution of your program. Do not pause at the end of the execution waiting for the user's input. Notes 1. Your program should use...

  • Write in C++ please: Write a class named MyVector using the following UML diagram and class...

    Write in C++ please: Write a class named MyVector using the following UML diagram and class attribute descriptions. MyVector will use a linked listed instead of an array. Each Contact is a struct that will store a name and a phone number. Demonstrate your class in a program for storing Contacts. The program should present the user with a menu for adding, removing, and retrieving Contact info. MyVector Contact name: string phone: string next: Contact -head: Contact -tail: Contact -list_size:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT