What does the following code do

Assignment Help Computer Engineering
Reference no: EM132217615

1. What would be the value of discountRate after the following statements are executed?

double discountRate;

char custType = 'B';

switch (custType)

{

case 'A': discountRate = 0.08;

break;

case 'B': discountRate = 0.06;

case 'C': discountRate = 0.04;

default: discountRate = 0.0;

}

A) 0.08
B) 0.06
C) 0.04
D) 0.02.

2. What does the following code do?

Scanner keyboard = new Scanner(System.in);
String filename;
System.out.print("Enter the filename: ");
filename = keyboard.readString();
PrintWriter outFile = new PrintWriter(filename);

A) It writes to a file named filename.

B) It allows the user to enter the name of the file that data will to be written to.

C) It establishes a connection with a file named filename.

D) Nothing. The code contains a syntax error.

Reference no: EM132217615

Questions Cloud

A derived class is generally smaller than its base class : In some programming languages, such as C#, Visual Basic, and Java, every class you create is a child of one ultimate base class, often called.
Create student login and student account page using html : Successful login will take you to the Account Information screen. They must provide a unique username that is at least 6 characters.
The director of it security is generally in charge : The tunnel can be created between a remote workstation using the public Internet and a VPN router or a secure browser and ________ Web site.
Which of the algorithms results in the minimum average : What is the turnaround time of each process for each of the scheduling algorithms in part a? Which of the algorithms results in the minimum average waiting time
What does the following code do : What would be the value of discountRate after the following statements are executed?
Which css attribute would change an elements font color : Which CSS attribute would change an element's font color to blue?
What is two-factor authentication : Of these three fundamental controls, which two are used by the Domain User Admin to create users and assign rights to resources?
Write a program that reads a sentence as input and converts : Write a program that reads a sentence as input and converts each word to "Pig Latin."
What is the corresponding c statement : For the contents of registers $s0 and $s1 as specified above, what is the value of $t0 for the following assembly code?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create a loop to go through the array and place each

Create a loop to go through the array and place each element one at a time into a file named outFile.txt.

  Can you think of a way to implement both stacks in one array

The total number of elements in the combined stacks is never more than 200 at any time, but we cannot predict how many are in each stack.

  Intrusion detection system or intrusion prevention system

Your company is deciding whether to employ the intrusion detection system (IDS), or an intrusion prevention system (IPS).

  Write a code to make a calculator which can perform

Write a code in C++ to make a calculator which can perform (Basic Arithmetic Operations, Factorial , addition of N terms,multiplication of N terms)

  What are the goals of each mechanism

In a virtual memory system, a process may be allocated more or fewer frames of memory by (at least) two different mechanisms or policies.

  What types of errors will simple parity not detect

What types of errors will simple parity not detect? What types of errors will longitudinal parity not detect?

  Comprise the code to calculate the time in the program

use BubbleSort and MergeSort and save them as bubble and merge. Test the running times of your implementations on randomly(!) generated integer sequences of size n = 10, 100, 1,000, and 10,000.

  Analyse system requirement to implement active directory

Analyse the system requirement to implement active directory and install the active directory domain services (AD DS) - implement active directory

  What is generated by the generate controller script

What is generated by the generate controller script? What must be placed in an application's controller class? In what directory are templates placed?

  What would be the effect on the program

Suppose the type of the cansPerPack variable in Volume1.java was changed from int to double. What would be the effect on the program?

  Write the portions of the render function needed

Write the portions of the render function needed to draw the picture below (snowman) using just these points.

  Explain what you have learned in this assignment

In this case assignment, you will write the SQL statement to work on the community library database. Following are the tasks you are necessary to perform.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd