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
harkovskaia [24]
2 years ago
13

Write a statement that defines an ifstream object named inputFile and opens a file named "Friends.txt".

Computers and Technology
1 answer:
Simora [160]2 years ago
5 0

Answer:

ifstream inputFile;

inputFile.open("Friends.txt");

Explanation:

Though, the programming language is not stated, questions like this are often from C++.

The first statement defines the ifstream object using the following syntax.

ifstream [object_name]

In this case, the object name is inputFile

So, the syntax becomes

ifstream inputFile;

The next line opens a file using the following syntax.

[object_name].open("Filename")

Here, object_name is inputFile and filename is Friends.txt

So, the open statement becomes

inputFile.open("Friends.txt")

You might be interested in
Write a q basic program to find the sum of all the even numbers from 1 to 50​
Artist 52 [7]

Answer:

CLS

M=2

SUM=0

DO WHILE M<=50

SUM=SUM+M

M=M+2

LOOP

PRINT " The sum of all even numbers between 1 and 50 is"; sum

5 0
3 years ago
Do You assign the Needs Met rating before assigning the page quality (PQ) rating?
tensa zangetsu [6.8K]
IS GOD REAL.......................?<span>

</span>
6 0
3 years ago
Write a C program that reads two hexadecimal values from the keyboard and then stores the two values into two variables of type
sattari [20]

Solution :

#include  $$

#include $$

#include $$

//Converts $\text{hex string}$ to binary string.

$\text{char}$ * hexadecimal$\text{To}$Binary(char* hexdec)

{

 

long $\text{int i}$ = 0;

char *string = $(\text{char}^ *) \ \text{malloc}$(sizeof(char) * 9);

while (hexdec[i]) {

//Simply assign binary string for each hex char.

switch (hexdec[i]) {

$\text{case '0'}:$

strcat(string, "0000");

break;

$\text{case '1'}:$

strcat(string, "0001");

break;

$\text{case '2'}:$

strcat(string, "0010");

break;

$\text{case '3'}:$

strcat(string, "0011");

break;

$\text{case '4'}:$

strcat(string, "0100");

break;

$\text{case '5'}:$

strcat(string, "0101");

break;

$\text{case '6'}:$

strcat(string, "0110");

break;

$\text{case '7'}:$

strcat(string, "0111");

break;

$\text{case '8'}:$

strcat(string, "1000");

break;

$\text{case '9'}:$

strcat(string, "1001");

break;

case 'A':

case 'a':

strcat(string, "1010");

break;

case 'B':

case 'b':

strcat(string, "1011");

break;

case 'C':

case 'c':

strcat(string, "1100");

break;

case 'D':

case 'd':

strcat(string, "1101");

break;

case 'E':

case 'e':

strcat(string, "1110");

break;

case 'F':

case 'f':

strcat(string, "1111");

break;

default:

printf("\nInvalid hexadecimal digit %c",

hexdec[i]);

string="-1" ;

}

i++;

}

return string;

}

 

int main()

{ //Take 2 strings

char *str1 =hexadecimalToBinary("FA") ;

char *str2 =hexadecimalToBinary("12") ;

//Input 2 numbers p and n.

int p,n;

scanf("%d",&p);

scanf("%d",&n);

//keep j as length of str2

int j=strlen(str2),i;

//Now replace n digits after p of str1

for(i=0;i<n;i++){

str1[p+i]=str2[j-1-i];

}

//Now, i have used c library strtol

long ans = strtol(str1, NULL, 2);

//print result.

printf("%lx",ans);

return 0;

}

4 0
2 years ago
Jim is a forensic specialist. He seized a suspect computer from a crime scene, removed the hard drive and bagged it, documented
Andreyy89

Answer: Jim left the computer unattended while shopping for supplies to be used at the next crime scene.

Explanation: While transporting the evidence to a secure location (lab), he left the computer unattended in his car and goes shopping for supplies that will be used in his next crime scenes. This act will give the criminals or their accomplice the opportunity to break into his car and tamper with what ever evidence he might have left behind in his car.

7 0
3 years ago
What does obsolete mean?
Alex
No longer produced or used; out of date.
8 0
2 years ago
Read 2 more answers
Other questions:
  • All of the following statements correctly describe an advantage or disadvantage associated with the use of Monte Carlo Analysis
    9·1 answer
  • Which of the following is not an algorithm?
    8·1 answer
  • In your own words, explain the role of scientific investigation in the development of the Theory of Evolution.
    6·1 answer
  • Debugging is not testing, but always occurs as a consequence of testing. <br> A) TRUE<br> B) FALSE
    13·1 answer
  • How do media and networks interact
    11·1 answer
  • i will be doing an interview to someone so plz comment down below something random and you will automatically enter
    11·1 answer
  • Consider the classes below: public class TestA { public static void main(String[] args) { ​ int x = 2; ​ int y = 20 ​ int counte
    6·1 answer
  • Explain to Alana why she might not want to blast her boss on social media just yet.<br>​
    6·1 answer
  • SOMEONE PLEASE HELP ME WITH THIS PLEASE HELP ME PLEASE!!!!!!
    6·1 answer
  • Which type of network consists of multiple Windows computers that share information, but no computer on the network serves as an
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!