Answer:
dataFile << salary;
Explanation:
To write salary to a file (payroll.dat) using ofstream, you make use of the following instruction:
<em>ofstream dataFile;
</em>
<em>myfile.open ("payroll.dat");
</em>
<em>myfile <<salary;
</em>
<em>myfile.close();</em>
<em />
This line creates an instance of ofstream
<em>ofstream dataFile;
</em>
This line opens the file payroll.dat
<em>myfile.open ("payroll.dat");
</em>
This is where the exact instruction in the question is done. This writes the value of salary to payroll.dat
<em>myfile <<salary;
</em>
This closes the opened file
<em>myfile.close();</em>
<em />
<em />
Abcdefghijklmnopqrstuvwxyz now I know my abcs, next time won’t you sing with me :)
Answer:
let cookieNumber = Math.floor(Math.random() * 10)
switch (cookieNumber) {
case 1:
document.write('Fortune 1')
break;
case 2:
document.write('Fortune 2')
break;
case 3:
document.write('Fortune 3')
break;
case 4:
document.write('Fortune 4')
break;
case 5:
document.write('Fortune 5')
break;
case 6:
document.write('Fortune 6')
break;
case 7:
document.write('Fortune 7')
break;
case 8:
document.write('Fortune 8')
break;
case 9:
document.write('Fortune 9')
break;
case 10:
document.write('Fortune 10')
Explanation:
The cookieNumber is generated using Math.random(), which is rounded to a whole number using Math.floor(). Then, a switch block is used to display a different fortune depending on the value of cookieNumber.
Answer:
for better future and attractive human life