1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stealth61 [152]
3 years ago
10

Explain what happens if you try to open a file for reading that does not exist.

Computers and Technology
1 answer:
ZanzabumX [31]3 years ago
8 0

Answer:

Exception is thrown and the file is created with 0 length.

Explanation:

While opening a file there is an error occur which shows the file does not exist that means an  exception is thrown.

And this error can be occur when the size of the file is very very low means the file is a size of 0 length. So to avoid this error we have to exceed its length from the zero length.

You might be interested in
Translate each of these statements into logical expressions using predicates, quantifiers, and logical connectives. a) Something
yKpoI14uk [10]

Answer:

Let P(x) = x is in the correct place

Let Q(x) =  x is in the excellent place

R(x) denotes the tool

Explanation:

a) Something is not in the correct place.

P(x) is that x is in the correct place so negation of ¬P(x) will represent x is not in the correct place. ∃x is an existential quantifier used to represent "for some" and depicts something in the given statement. This statement can be translated into logical expression as follows:

                                                    ∃x¬P(x)

b) All tools are in the correct place and are in excellent condition.

R(x) represents the tool, P(x) represents x is in correct place and Q(x) shows x is in excellent place. ∀ is used to show that "all" tools and ∧ is used here because tools are in correct place AND are in excellent condition so it depicts both P(x) and Q(x). This statement can be translated into logical expression as follows:

                                       ∀ x ( R(x) → (P(x) ∧ Q(x))

c) Everything is in the correct place and in excellent condition.

Here P(x) represents correct place and Q(x) represents excellent condition ∀ represent all and here everything. ∧  means that both the P(x) and Q(x) exist. This statement can be translated into logical expression as follows:

                                              ∀ x (P(x) ∧ Q(x)

7 0
3 years ago
What is wrong with each of the following?
ankoles [38]

Answer:

The answer to this question is given below in the explanation section

Explanation:

shoNum + shoNum2 = shoTotal

in this code statement,  the order of operation is wrong because the calculation in programming always done at the right side of dependent variables.  so the correct statement of code is

<em> shoTotal = shoNum + shoNum2;</em>

shoNum = 10 * 4

This statement is programmatically correct, because the ShoNum value becomes 40 after performing the multiplication operation on its assigned value  (10 multiply by 4). However, it is noted that the empty space mostly ignored by the compiler. So, the correct is <em>shoNum = 10*4;</em>

Dim decPrice As Decimal = "$4.99"

The dollar sign is appeared in along with its value. So, if you assign value to a decimal variable, you need to assign only digit value (do not mix value with symbol or text) and also do not put quotation marks around value, if you put quotation marks around value then this value will be consider as a text value.

So, the correct statement is :

<em>Dim decPrice As Decimal = 4.99;</em>

shoCube= (shoSide)3

In this statement, cube is calculated of shoSide variable, mathematically it is right, but programmatically it is incorrect. Because, you missed the multiplication operation (*) between the operand shoSide and 3. it should

be as  shoSide raise to power 3.

the correct statement is : shoCube = (shoSide * shoSide *shoSide);

4 0
3 years ago
Write a program that finds the largest in a series of numbers entered by the user.The program must prompt the user to enter numb
Kobotan [32]

Answer:

Here is c program:

#include<stdio.h>

#include<conio.h>

void main()

{

//Variable declaration

//array to hold 6 values you can change this as needed

float nums[6];

//integer i is for loop variable

int i;

//to hold maximum value

float max=0.0;

//clear screen

clrscr();

//iterate 6 times you can change as per your need

for(i=0;i<6;i++)

{

printf("Enter a number:");

scanf("%f",&nums[i]);

//check if entered value is greater than previous value

//if it is greater then assign it

if(nums[i]>max)

max = nums[i];

}

//print the value

printf("The largest number entered was %f",max);

getch();

}

Explanation:

4 0
3 years ago
In the second example with modulus math, why can't Eve find the solution?
Leno4ka [110]
C. She would have to resort to trial and errors to find a matching exponent
6 0
3 years ago
If you are installing separate anti-virus and anti-spyware programs, which should you install first
Vera_Pavlovna [14]
Probably the anti virus, so you don't get a virus from downloading the anti spyware program.
6 0
3 years ago
Other questions:
  • When looking at an object or process to code, it is important to think of as general a solution as possible and consider all the
    13·1 answer
  • Angle, oblique, regular, demi, roman, heavy, extra bold, expanded, and compressed are ___________ . Select one: A. type styles B
    10·1 answer
  • What is the voltage drop across R4 in the diagram shown above?
    13·1 answer
  • Florida Highway Safety and Motor Vehicles reported blank of traffic fatalities were alcohol-related in Florida in 2009.​
    8·1 answer
  • If metal shims are used for alignment adjustment in the front, they adjust ________.
    5·1 answer
  • Please answer this correctly what’s the answer opening modify style dialog box enables you to
    8·1 answer
  • Write a method that determines the total number of chars in each string of an array.
    12·1 answer
  • Use the function random.randint to write a program that rolls a 6-sided die 100 times, and prints out all of the rolls.
    8·1 answer
  • Because travel distance, cost of living, and other factors vary among the three regions, the annual cost of having a salesperson
    14·1 answer
  • Please help!!
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!