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 :)
please answer all question CSE 110 Introduction to Computer Science 41. An array of size 10,...
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. **** *** 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: 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 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) 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 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, 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 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 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 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:...