Breaking News

CS101: Introduction to Computer Science I Certification Exam Answers

Introduction to Computer Science is a foundational course that provides students with an overview of fundamental concepts and principles in the field of computer science. It serves as a gateway for individuals interested in pursuing further studies or careers in computing-related disciplines. Here’s an outline of what typically might be covered in such a course:

  1. Overview of Computer Science: Introducing the scope and importance of computer science in modern society, including its historical development and current trends.
  2. Basic Concepts of Computing: Covering fundamental concepts such as algorithms, data structures, and computational thinking. This section often includes an introduction to programming languages and their syntax.
  3. Problem Solving and Algorithm Design: Teaching students how to approach problems systematically, breaking them down into smaller, manageable tasks, and designing efficient algorithms to solve them. This may involve techniques like pseudocode, flowcharts, and problem-solving strategies.
  4. Data Representation and Storage: Explaining how data is represented and stored in computers, including concepts like binary representation, character encoding, and data types.
  5. Computer Architecture: Providing an overview of computer hardware and organization, including the CPU, memory, input/output devices, and the von Neumann architecture.
  6. Operating Systems: Introducing the role and functions of operating systems, including process management, memory management, file systems, and user interfaces.
  7. Networking and the Internet: Explaining the basics of computer networks, protocols, and the internet, including concepts like IP addresses, DNS, HTTP, and TCP/IP.
  8. Software Engineering: Introducing software development methodologies, such as the waterfall model, agile development, and DevOps. This section may also cover topics like version control, testing, and debugging.
  9. Databases and SQL: Providing an introduction to database management systems (DBMS), relational databases, and Structured Query Language (SQL), including concepts like data modeling, normalization, and database design.
  10. Artificial Intelligence and Machine Learning: Touching upon the basics of AI and ML, including algorithms like neural networks, decision trees, and support vector machines. This section may also cover applications of AI and ethical considerations.
  11. Computer Security and Privacy: Discussing the principles of cybersecurity, common threats, encryption techniques, and best practices for protecting data and systems.
  12. Social and Ethical Implications of Computing: Examining the societal impact of technology, including issues related to privacy, intellectual property, digital divide, and ethical considerations in algorithm design and AI.

Throughout the course, students typically engage in hands-on programming assignments, projects, and practical exercises to reinforce theoretical concepts and develop problem-solving skills. Additionally, discussions, readings, and case studies may be used to explore real-world applications and current issues in computer science.

CS101: Introduction to Computer Science I Exam Quiz Answers

CS101 Introduction to Computer Science I
  • Radio
  • Telegraph
  • FORTRAN
  • Vacuum tubes
  • Declarative
  • Exclamatory
  • Imperative
  • Question
  • Design, implementation, and testing
  • Requirements, construction, and testing
  • Design, construction, and implementation
  • Requirements, design, and implementation
  • Architecture
  • Flowchart
  • Procedure
  • Process
  • A set of general steps needed to perform a stage of the system life cycle
  • A set of tools that supports the activities of each stage of the system life cycle
  • A set of processes that guides the stages of the system development life cycle
  • A procedure that specifies detailed steps to perform a stage of the system life cycle
  • Functional
  • Imperative
  • Logic
  • Object
  • Lease the JDK
  • Purchase a JDK license
  • Purchase a copy of JDK
  • Accept the JDK license terms
  • sample.exe
  • sample.java
  • sample.class
  • sample.bytecode
  • Creativity
  • Curiosity
  • Ethics
  • Logic
  • It Increases software development costs and improves software quality
  • It decreases software development costs and improves software quality
  • It increases software life-cycle costs and decreases coupling of implementation and use
  • It decreases software life-cycle costs and increases coupling of implementation and use
  • Data and related object-oriented functions
  • A data type for a set of object-oriented programs
  • An object-oriented construct for saving the state of an object
  • A program construct used to define objects that share common attributes
  • Any Java object type
  • Any primitive data type
  • Only char and string types
  • Only primitive numeric types
  • Any text editor may be used to create a Java source program
  • Java source files can be of many file types, such as .txt, .java, .xml, or .docx
  • The file name of a Java source file must be the name of the only public class in the file
  • Word Processing software such as Microsoft Word is often used to create Java source programs
  • Include the Java package in the Java command line
  • Include the Java package in the Javoc command line
  • Import the Java package anywhere in the java source file
  • Import the Java class at the beginning of the java source file
  • short
  • int
  • logic
  • string
  • Using double, calculate 7 / 2
  • Using int, calculate 50000 + 5000000
  • Using short, calculate 1+2+3+……+200
  • Using unsigned int, calculate 100 – 5000
  • -2
  • -1
  • 0
  • 1
  • Technology t
  • through engineering to design.
  • Technology through engineering to design.
  • A compile error, since a string is immutable
  • Any Java object type
  • Any primitive data type
  • Only char and string types
  • Only primitive numeric types
  • (grade >= 70) && (grade < 80)
  • (grade <= 80) && (grade > 70)
  • !(grade < 70) || !(grade >79)
  • !((grade < 70) || (grade >79))
  • (A&amp;&amp; B) || !B
  • (A &amp;&amp; B) || !A
  • (A || B) &amp;&amp; (!A || B)
  • (B &amp;&amp; !A) || (A &amp;&amp; B)
  • They have the same form
  • They have the same values
  • They have the same truth tables
  • They have the same symbols in the same order
  • int x;
  • x = 1;
  • if then
  • puts
  • if (roomLength == 20) (if (visualAcuity – 1.0 < .001))

// checks for acuity equal to 1+-.001

System.out.println(“Recommended font size for a room of length “

+ roomLength + ” is: ” + DisplayPixel (roomLength, visualAcuity));

//DisplayPixel is a function call that does the engineering calculation

  • if (roomLength == 20) if (visualAcuity – 1.0 < .001)

// checks for acuity equal to 1+-.001

System.out.println(“Recommended font size for a room of length “

+ roomLength + ” is: ” + DisplayPixel (roomLength, visualAcuity));

//DisplayPixel is a function call that does the engineering calculation

  • if (roomLength == 20) {if (visualAcuity – 1.0 < .001)

// checks for acuity equal to 1+-.001

System.out.println(“Recommended font size for a room of length ” +

roomLength + ” is: ” + DisplayPixel (roomLength, visualAcuity))};

//DisplayPixel is a function call that does the engineering calculation

  • if (roomLength == 20) if (visualAcuity – 1.0 < .001)

// checks for acuity equal to 1+-.001

{System.out.println(“Recommended font size for a room of length ” +

roomLength + ” is: ” + DisplayPixel (roomLength, visualAcuity))};

//DisplayPixel is a function call that does the engineering calculation

  • Variables in expression and label1 can be global variables
  • label1 and the variables in expression must be of integer type
  • expression must evaluate to an integer and label1 must be an integer literal
  • If expression equals the variable label1, the statements of label1 are executed
  • int cost, ticket = 1; //value of ticket comes from System.in

for (; ticket != 0;) {

    cost = ticket;

    System.out.println(“ticket cost $” + cost);

    System.out.println(“ticket wins $” + cost * 10);

    ticket = value; // ticket given a value of 1, 5, 9 from input

    break;              

}

  • int cost, ticket; //value of ticket comes from System.in

for (; ticket != 0;) {

    cost = ticket;

    System.out.println(“ticket cost $” + cost);

    System.out.println(“ticket wins $” + cost * 10);

    ticket = 1; // ticket given a value of 1, 5, 9 from input

}

  • int cost, ticket = 1; //value of ticket comes from System.in

for (; ticket != 0;) {

    ticket = cost;

    System.out.println(“ticket cost $” + cost);

    System.out.println(“ticket wins $” + cost * 10);

    ticket = 1; // ticket given a value of 1, 5, 9 from input

    break;

}

  • int cost, ticket = 1; //value of ticket comes from System.in

for (;;;) {

    cost = ticket;

    System.out.println(“ticket cost $” + cost);

    System.out.println(“ticket wins $” + cost * 10);

    ticket = 1; // ticket given a value of 1, 5, 9 from input

}

  • By class data
  • By static data
  • By local variables
  • By method arguments
  • The program name in which the method is defined and a dot
  • The name of the class in which the method is defined and a dot
  • The name of an instance of the class in which the method is defined and a dot
  • The keyword new followed by the name of a class constructor for the method
  • An array is a java object
  • An array parameter is passed by reference
  • An array can be used to group different types
  • Components of an array are accessed by simple identifiers

Answer: Option D

  • for (Car findCar: inventory) {

    findCar.statusCar = “in”;

    System.out.print(findCar.typeCar + ” “);

    System.out.print(findCar.modelCar + ” “);

    System.out.println(findCar.statusCar + ” “);

}

  • int[] indexArray = { 0, 1, 2 };

for (int findCar: indexArray) {

    inventory[findCar].statusCar = “in”;

    System.out.print(inventory[findCar].typeCar + ” “);

    System.out.print(inventory[findCar].modelCar + ” “);

    System.out.println(inventory[findCar].statusCar + ” “);

}

  • Car[] indexArray = { inventory[0], inventory[1], inventory[2] };

for (int findCar: indexArray) {

    findCar.statusCar = “in”;

    System.out.print(findCar.typeCar + ” “);

    System.out.print(findCar.modelCar + ” “);

    System.out.println(findCar.statusCar + ” “);

}

  • Car[] indexArray = { inventory[0], inventory[1], inventory[2] };

for (Car findCar: inventory) {

    findCar.statusCar = “in”;

    System.out.print(findCar.typeCar + ” “);

    System.out.print(findCar.modelCar + ” “);

    System.out.println(findCar.statusCar + ” “);

}

  • System.read
  • System.err
  • System.util.scanner.nextInt()
  • System.util.scanner.nextLine()
  • When data used by a program is useful for other programs
  • When data used by a program is dependent on the program
  • When you want the program to write its data faster than to external file
  • When you want the program to read its data faster than from an external file
  • The Scanner class can be used to read byte data
  • The Scanner class can be used to read input data
  • Data can only be read from a file using the FileReader class.
  • The Scanner class can only be used to read data from the keyboard
  • Hello World
  • It would give a null pointer exception
  • It would give an array store exception
  • It would give an out of bounds exception
  • 3, 7, 11
  • 3, 7, 9, 13
  • 3, 7, 11, 13
  • 3, 7, 9, 11, 13
  • Each atomic statement is assigned the value True
  • Each atomic statement is assigned the value False
  • If an atomic statement is true, it is assigned the value True; otherwise it is False
  • A sequence of n atomic statements is assigned 2n permutations of True and False
  • GUI
  • RAM
  • Cache
  • Transistor
  • Design and implementation
  • Implementation and Testing
  • Requirements and Design
  • Requirements and Testing
  • run sample
  • java sample
  • run sample.class
  • java sample.class
  • To make decisions
  • To discover new information
  • To execute sets of instructions
  • To recognize problems and create solutions
  • Objects and messages
  • Functions and operations
  • Predicates and operations
  • Data and control statements
  • A set of values for a data type
  • A data type and its associated programs
  • A construct that characterizes a member of a class
  • A set of constructs that communicate via messages
  • java Hello
  • javac Hello
  • java Test.java
  • javac Test.java
  • A collection of classes used by a program
  • A collection GUI tools used by a program
  • A collection of objects that make up a program
  • A collection of programs used by an application
  • 231
  • 264
  • (232)-1
  • (264)-1
  • binary
  • decimal
  • double
  • long
  • !(x > y)
  • -x <= -y
  • (x < y) && (x = y)
  • (x +1) >= (y + 1)
  • if (status = ‘e’) {

    if (credits >= 60)

        System.out.println(“student:”, studentID);

};

  • (if status == ‘e’) {

    (if credits >= 60)

    System.out.println(“student:”, studentID);

};

  • if (status = ‘e’) {

    if (credits! < 60)

        System.out.println(“student:”, studentID);

};

  • int age, weight;

(age >= 18 && age <= 60) && (weight >= 110))

  • long age, weight;

(age >= 18. && age <= 60.) && (weight >= 110.)

  • int ageInMonths ; long weight;

(ageInMonths >= 216 && ageInMonths <= 720) && (weight >= 110.)

  • int ageInMonths; long weight;

(ageInMonths >= 216 && ageInMonths <= 720) && (weight > 109.9999)

  • (weight >= 110) && (age >= 17) && (iron2 >12.0)
  • ((weight >= 110) && (age >= 17)) || ((iron1 >= 12.0) || (iron2 >= 12.0))
  • ((weight >= 110) && (age >= 17)) && ((iron1 >= 12.0) || (iron2 >= 12.0))
  • ((weight >= 110) && (age >= 17) && (iron1 >12.0)) || ((weight >= 110) && (age >= 17) && (iron2 >12.0))
  • int routeNum = 95;

if (routeNum % 2 == 0)

    System.out.println(“Route ” + routeNum + ” runs east-west”)

else System.out.println(“Route ” + routeNum + ” runs north-south”);

  • int routeNum = 95;

if (routeNum % 2 == 0)

    System.out.println(“Route ” + routeNum + ” runs east-west”);

else System.out.println(“Route ” + routeNum + ” runs north-south”);

  • int routeNum = 95;

(if routeNum % 2 == 0)

    System.out.println(“Route ” + routeNum + ” runs east-west”);

else System.out.println(“Route ” + routeNum + ” runs north-south”);

  • int routeNum = 95;

if (routeNum % 2 == 0)

    System.out.println(“Route ” + routeNum + ” runs east-west”);

else {

    System.out.println(“Route ” + routeNum + ” runs north-south”);

}

  • case 2
  • label 3
  • It would give a compile error
  • It would give a runtime error
  • A calls any method of B
  • A calls a public method of B
  • A calls one of its methods which interfaces with B
  • A calls a class script, which in turn shares data with B
  • public class Main {

    public static void main(String[] args) {

        changeInstanceData(4);

    }

}

  • public static void main(String[] args) {

    instanceData = 4;

}

  • public static void main(String[] args) {

    ClassName obj = new ClassName();

    obj.instantData = 4;

}

  • public static void main(String[] args) {

    ClassName obj = new ClassName();

    obj.ChangeInstanceData(4)

}

  • An enhanced for-loop uses subscripts to incrementally access elements of an array.
  • An enhanced for-loop has a concise structure related syntax for iterating over an array.
  • An enhanced for-loop generates validity checks for indices used in the body of the loop.
  • An enhanced for-loop uses for-loop features together with structure related features to iterate over an array.
  • String s1 = ” CUSTOMER”;

String s2 = ” NAME”;

String s3 = ” ID#”;

System.out.println(“%2$s %1$s”, “s1+s2”, “s3”);

String s1 = ” CUSTOMER”;

String s2 = ” NAME”;

String s3 = ” ID#”;

System.out.println( % 2 $s % 1 $s “, s1+s2, s3.;   

  • String s1 = ” CUSTOMER”;

String s2 = ” NAME”;

String s3 = ” ID#”;

String heading = String.format(“%2$s %1$s”, s1 + s2, s3.;

System.out.println(heading);

  • String s1 = ” CUSTOMER”;

String s2 = ” NAME”;

String s3 = ” ID#”;

String heading = String.format(“%2$s %1$s”, “s1+s2”, “s3”);

System.out.println(heading);

  • import java.io.*;

class WriteCarFile {

    public static void main(String[] args) throws IOException {

        String carfileName = “CarInventory.txt”;

        writer.open();

        FileWriter writer = new FileWriter(carfileName, true);

        writer.write(“4 LCAR Audi 0 in\n”);

        writer.write(“5 FFAR Suburban 0 in\n”);

        writer.write(“6 PPAR Ford150 0 in\n”);

        writer.close();

    }

}

  • import java.io.*;

class WriteCarFile {

    public static void main(String[] args) {

        String carfileName = “CarInventory.txt”;

        FileWriter writer = new FileWriter(carfileName, false);

        writer.write(“4 LCAR Audi 0 in”);

        writer.write(“5 FFAR Suburban 0 in”);

        writer.write(“6 PPAR Ford150 0 in”);

        writer.close();

    }

}

  • import java.io.*;

class WriteCarFile {

    public static void main(String[] args) throws IOException {

        String carfileName = “CarInventory.txt”;

        FileWriter writer = new FileWriter(carfileName, true);

        writer.write(“4 LCAR Audi 0 in\n”);

        writer.write(“5 FFAR Suburban 0 in\n”);

        writer.write(“6 PPAR Ford150 0 in\n”);

        writer.close();

    }

}

  • import java.io.*;

class WriteCarFile {

    public static void main(String[] args)

    {

        String carfileName = “CarInventory.txt”;

        FileWriter writer = new FileWriter(carfileName, true);

        writer.write(“4 LCAR Audi 0 in\n”);

        writer.write(“5 FFAR Suburban 0 in\n”);

        writer.write(“6 PPAR Ford150 0 in\n”);

        writer.close();

    }

}

  • At run-time
  • At design time
  • At compile time
  • During requirements specification
  • Every method
  • A method that might cause an exception
  • Only the methods that have a ‘catch’ clause
  • A method that might cause an exception, and each method in its chain
  • ‘null’
  • Unspecified
  • False or True
  • False and True
  • When it is not possible for P or Q to be true and R false
  • When it is not possible for P and Q to be true and R false
  • When it is not possible for P or Q to be false and R true
  • When it is not possible for P and Q to be false and R true
  • Objects
  • Network support
  • Memory management
  • Communication support
  • To test Java programs
  • To analyze Java programs
  • To compile Java programs
  • To document Java programs
  • It promotes platform independence
  • It promotes program interdependence
  • It allows for encapsulation of data and procedures
  • It has greater execution efficiency compared to older paradigms
  • public, static, String, void
  • args, public, static, String, void
  • main, public, static, String, void
  • args, main, public, static, String, void
  • It can be anywhere in the Java source file
  • It makes the names of external classes visible
  • It includes external classes in a java source file
  • Together with *, it makes a class and subclasses visible
  • 1
  • x
  • x+1
  • An error
  • y
  • null
  • blank
  • empty
  • label 1
  • label 1

label 2

  • It would give a compile error
  • It would give a runtime error
  • int array1[4];
  • int[4] array1;
  • int[] array1 = new int[4];
  • int array1[] = new Array[4];

Answer: Option A

  • public static void main (String [] args) {

Car [] inventory = new Car [1000];

int [] i = {0, 1, 2, …, inventory. length – 1};

//assume the dots are the intervening digits

inventory [0] = new Car (“LCAR”, “Infinity”, 0, “in”);

inventory [1] = new Car (“FFAR”, “Expedition”, 0, “in”);

inventory [2] = new Car (“SFAR”, “Explorer”, 0, “in”);

//assume the dots represent the code to initialize the rest of inventory

for (int index: i) {

if (index >= 0 && index < inventory. length)

System.out.println(inventory[index]. idCar + ” “

+ inventory[index]. typeCar + ” ” + inventory[index]. modelCar

+ ” ” + inventory[index]. statusCar);

}

}

  • public static void main (String [] args) {

Car [] inventory = new Car [];

int [] i = {0, 1, 2, …, inventory. length – 1};

//assume the dots are the intervening digits

inventory [0] = new Car (“LCAR”, “Infinity”, 0, “in”);

inventory [1] = new Car (“FFAR”, “Expedition”, 0, “in”);

inventory [2] = new Car (“SFAR”, “Explorer”, 0, “in”);

//assume the dots represent the code to initialize the rest of inventory

for (int index: i) {

if (index >= 0 && index < inventory. length)

System.out.println(inventory[index]. idCar + ” “

+ inventory[index]. typeCar + ” ” + inventory[index]. modelCar

+ ” ” + inventory[index]. statusCar);

}

}

  • public static void main (String [] args) {

Car [] inventory = new Car [1000];

int [] i = {0, 1, 2, …, inventory. length – 1};

//assume the dots are the intervening digits

inventory [0] = new Car (“LCAR”, “Infinity”, 0, “in”);

inventory [1] = new Car (“FFAR”, “Expedition”, 0, “in”);

inventory [2] = new Car (“SFAR”, “Explorer”, 0, “in);

//assume the dots represent the code to initialize the rest of inventory

for (int index: i) {

if (i >= 0 && i < inventory. length)

System.out.println(inventory[i]. idCar + ” ” + inventory[i]. typeCar

+ ” ” + inventory[i]. modelCar + ” ” + inventory[i]. statusCar);

}

}

  • public static void main (String [] args) {

Car [] inventory = new Car [1000];

int [] i = {0, 1, 2, …, inventory. length – 1};

//assume the dots are the intervening digits

inventory [0] = new Car (“LCAR”, “Infinity”, 0, “in”);

inventory [1] = new Car (“FFAR”, “Expedition”, 0, “in”);

inventory [2] = new Car (“SFAR”, “Explorer”, 0, “in”);

… //assume the dots represent the code to initialize the rest of inventory

for (int index: i) {

if (index >= 0 && index < inventory. length)

System.out.println(inventory[index]. idCar

+ ” ” + inventory[index]. typeCar + ” “

+ inventory[index]. modelCar + ” ” + inventory[index]. statusCar);

}

}

  • A text editor
  • The JRE interpreter
  • The JDK Java editor
  • Windows Visual Studio
  • Inheritance
  • Constructors
  • Polymorphism
  • Declaration keywords
  • False

False

  • False

True

  • True

False

  • True

True

  • Transacting an online bank deposit
  • Performing a computation specified by an equation
  • Selecting the next statement to execute based on a condition
  • Executing a block of code repetitively using different data values
  • String str = “John”;

String.length(str);

  • String str = new String(“John”);

length(str);

  • String str = new String(“John”);

String.length(str);

  • for (int row, col = 0; row < 100 and col < 3; row++) {

    if (inventory[row][1] == “mid” &&

        inventory[row][2] == “chv”);

}

  • for (int row, col = 0; row < 100 and col < 3; row++) {

    if (inventory[row][col] == “mid” &&

        inventory[row][col + 1] == “chv”);

}

  • for (int row, col = 0; col < 3 && row < 100; col++) {

    if (inventory[col][row] == “mid” &&

        inventory[col][2] == “chv”);

}

  • for (int row, col = 0; col < 3 && row < 100; col++) {

    if (inventory[col][row] == “mid” &&

        Inventory[col][row + 1] == “chv”);

}

  • mystring

ok

123

mystring

  • mystring

mystring

ok

123

123

  • mystring

123

ok

123

  • It would give an execution error
  • define and allocate a file object

use the object’s write method to write string fields

use the object’s close method to close the file

  • construct a FileWriter object with a file name

use the objects write method to write character lines to the file

use the objects close method to close the file

  • declare a file name

construct a FileWriter object with that defined file name

use a FileWriter method to write string lines to the file

use a FileWriter method to close the file

  • define a file name

use the FileWriter open method to allocate a file with that name

use the FileWriter write method to write byte to that file

use the FileWriter close method to close the file

  • Scanner methods can be used to read a text file
  • A File class object is attached to a Scanner object
  • A File class method can be used to check for end of file
  • Scanner.class methods do not throw file related checked exceptions
  • The second generation, which was characterized by transistors
  • The third generation, which was characterized by integrated circuits
  • The fourth generation, which was characterized by very-large-scale integration
  • The fifth generation, which was characterized by massive parallel hardware
  • They improve the performance of the process
  • They remove the people involved in the process
  • They generate ideas for how to streamline the process
  • They decrease the amount of data involved in the process
  • B is a subclass of A, and C is a subclass of B
  • A is a subclass of B, and B is a subclass of C
  • A is a superclass of C, and B is a superclass of C
  • A is a superclass of B and C, and C is a subclass of A
  • 123. is the same as “123F”
  • A short type can represent 34567
  • An int can represent about 8 digits of precision
  • A float can represent about 7 digits of precision
  • true
  • false
  • It would give a syntax error
  • It would give a runtime error
  • A &amp; &amp; B
  • ! A &amp; &amp; B
  • ! A &amp; &amp; B
  • ! (A &amp; &amp; B)
  • A
  • B
  • (! A OR B) AND (A OR! B)
  • (! A AND! B) OR (A AND! B)
  • import java.util.*
  • long size = 1234567890;
  • System.out.println(“Hello world!”);
  • try {System.out.println(s. substring(start))};
  • import java.io. *;

import java. util. Scanner;

public class CarInventory {

public static void main (String [] args) {

Scanner fileScr;

Scanner keyBoardScr;

String fileName = “carInventory.txt”;

keyBoardScr = new Scanner (System.in);

try {

File carFile = new File(fileName);

fileScr = new Scanner(carFile);

} catch (IOException e) {

e. printStackTrace ();

}

String car = null;

if (fileScr.hasNext())

car = fileScr.next();

while (car! = null) {

System.out.println(car);

car = fileScr.next();

}

}

}

  • import java.io. *;

import java. util. Scanner;

public class CarInventory {

public static void main (String [] args) {

Scanner fileScr;

String fileName = “carInventory.txt”;

keyBoardScr = new Scanner (System.in);

try {

File carFile = new File(fileName);

fileScr = new Scanner(carFile);

} catch (IOException e) {

e. printStackTrace ();

}

String car = null;

if (fileScr.hasNext())

car = fileScr.next();

while (car! = null) {

System.out.println(car);

car = fileScr.next();

}

}

}

  • import java.io. *;

import java. util. Scanner;

public class CarInventory {

public static void main (String [] args) {

Scanner fileScr;

Scanner keyBoardScr;

keyBoardScr = new Scanner (System.in);

try {

File carFile = new File(fileName);

fileScr = new Scanner(carFile);

} catch (IOException e) {

e. printStackTrace ();

}

String car = null;

if (fileScr.hasNext())

car = fileScr.next();

while (car! = null) {

System.out.println(car);

car = fileScr.next();

}

}

}

  • import java.io. *;

import java. util. Scanner;

public class CarInventory {

public static void main (String [] args) {

Scanner fileScr;

Scanner keyBoardScr;

String fileName = “carInventory.txt”;

Scanner keyBoardScr = new Scanner (System.in);

try {

File carFile = new File(fileName);

fileScr = new Scanner(carFile);

} catch (IOException e) {

e. printStackTrace ();

}

String car = null;

if (fileScr.hasNext())

car = fileScr.next();

while (car! = null) {

System.out.println(car);

car = fileScr.next();

}

}

}

  • Machine independence
  • Many low-level facilities
  • An object model, like C++
  • Manual memory management
  • .html
  • .java
  • .jdoc
  • .txt
  • C is an object
  • CQ is an object
  • CQ is a subclass of C
  • CQ is a parent of class C
  • They have the same class data and behavior
  • They have different class data and behavior
  • They have the same class data and different behavior
  • They have different class data and the same behavior
  • A category of data that is part of the Java language
  • A user-defined class that declares a set of variables
  • A user-defined object that declares a set of identifiers
  • A piece of information needed by the Java Virtual Machine
  • 0
  • 0.5
  • 1/2
  • 1
  • They define the data that is stored
  • They change the data that is stored
  • They determine the order in which code is executed
  • They declare the name and type of data that is input
  • Conditions
  • Counters
  • Sentinels
  • Updaters
  • Traditional error handling
  • Default exception handling
  • Java’s exception-handling model
  • Terminate the program by calling System.exit
  • 1.1
  • integer 1.1
  • It would give a run-time exception
  • It would give a compile format error
  • UNIX
  • Transistors
  • Vacuum tubes
  • Integrated circuits
  • Composition of detailed components
  • Decomposition into major components
  • Hierarchy of components and subcomponents
  • Language for forming instructions that control components
  • Abstraction
  • Composition
  • Decomposition
  • Language

About Clear My Certification

Check Also

CS402 Computer Communications and Networks

CS402: Computer Communications and Networks Certification Exam Answers

Computer communications and networks refer to the systems and infrastructure that enable communication and data …

Leave a Reply

Your email address will not be published. Required fields are marked *