Reference no: EM13168511
finish or complete the coding for me. because syntax and codes, so the proram can execute correctly
// bases.cpp
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
/* Include all necessary using statements from iostream */
#include <iomanip>
/* Include all necessary using statements from iomanip */
#include <cmath>
/* Write a user-defined manipulator width8 that sets
the width to 8 */
/* Write a user-defined manipulator width12 that sets
the width to 12 */
// function to convert a decimal number to a binary number
int convertBinary( int x )
{
int power, result = 0;
for ( power = 0; x >= pow( 2, power ); power++ ) ;
for ( ; power >= 0; power-- ) {
result *= 10;
if ( x / pow( 2, power ) >= 1 ) {
result++;
x -= pow( 2, power );
}
}
return result;
}
void printTable( int a[], const int size )
{
cout << "\nTable with the numbers in various bases\n";
/* Write a statement to left justify the following table */
/* Write a statement to print the header, use the width8
manipulator for spacing */
for ( int i = 0; i < size; i++ )
/* Write a statement to output the table of bases */
/* Octadecimal output should specify the base */
/* Hexadecimal output should include only uppercase */
cout << "\nTable of formatted and unformatted "
<< "floating points\n";
/* Write a statement to print header, use the width12
manipulator for spacing */
for ( int j = 0; j < size; j++ ) {
double x = static_cast< double > ( a[ j ] );
/* Write a statement to output the formatted vs.
unformatted table */
/* Formatted output should print in scientific notation,
showing the decimal point and the sign, and
have a precision of 2 */
/* Undo formatting changes */
}
}
int main()
{
int x[ 5 ] = { 0 };
for ( int counter = 0; counter < 5; counter++ ) {
cout << "enter number " << counter + 1 << ": ";
cin >> x[ counter ];
/* Write a statement to test if stream errors occurred */
/* If there were stream errors, input another number */
}
printTable( x, 5 );
return 0;
}
The main function should prompt the user
: The main function should prompt the user for the 2 numbers, call the function to display the correct label, then calculate and display the sum of the numbers. Call the function to display the correct label, then calculate and display the differenc..
|
What are bufferedinput/outputstreams
: What are BufferedInput/OutputStreams and why are they used? Write some Java code to illustrate how to create a BufferedInputStream.
|
Prepare a pension worksheet for the pension plan
: Prepare a pension worksheet for the pension plan in 2012 and prepare any journal entries related to the pension plan that would be needed at December 31, 2012.
|
All your code should be in the main method
: Write a Java test program, all your code should be in the main method, that asks the user for two numbers representing an investment value and interest rate
|
Finish or complete the coding for me because syntax and code
: finish or complete the coding for me. because syntax and codes, so the proram can execute correctly
|
Result of increasingly sophisticated it
: Discuss several career opportunities available to students who combine a study of accounting with course work in AISs, information systems, and/or computer science. Can you think of other jobs where these skill sets would be desirable?
|
Whenever a computer is idle
: Whenever a computer is idle, we can either put it in stand by (where DRAM is still active) or we can let it hibernate. Assume that, to hibernate
|
Calculate the fraction of methyl isonitrile molecules
: The activation energy for the isomerization of methyl isonitrile (see figure) is 160 kJ/mol. Calculate the fraction of methyl isonitrile molecules that has an energy of 160.0 kJ or greater at 493 K.
|
What speedup could be expected in the steady state
: What speedup could be expected in the steady state by using a merging write buffer instead of a nonmerging buffer when zeroing memory by the execution of 64 bit stores if all other instructions could be issued in parallel with the stores and the b..
|