Finish or complete the coding for me because syntax and code

Assignment Help C/C++ Programming
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;

}

 

 

Reference no: EM13168511

Questions Cloud

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..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Prepare a linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM

  Create if-then statement with single alternative decision

Create the If-Then statement (or a flowchart with a single alternative decision structure) which assigns 20 to  variable y and allots 40 to variable z if variable x is greater that 100.

  Write a c++ program that would take two 3x3 matrix

Write a C++ program that would take two 3x3 matrix and outputs the results of adding, subtracting and multiplying two matrices. Create at least three functions: one that performs addition,

  Make a class constructor that initializes a customer

Make a class constructor that initializes a customer with a name, number, and order size.Make class member functions to print each of: name, number, and order size.

  Write a c function to convert gallons-quarts-pints and cups

Write a C function named liquid() that is to accept an integer number and the addresses of the variables gallons, quarts, pints, and cups.

  Operating system and cpu scheduling

Operating System and CPU Scheduling

  Prepare the weighted scoring model for three exams

Prepare the weighted scoring model. Final grades are based on three exams worth 15%, 20%, and 25%, respectively; homework is worth 20%.

  Keep track of the size of the array

Keep track of the size of the array so that you cannot exceed the array boundaries. The implementation details (i.e. the private members)of your class are up to you, but the class should have the following public interface

  Include a main function that will solicit

Include a main function that will solicit a DNA sequence string from the user, call the genes function to obtain all the genes in the sequence and print each one on the console display

  Two-dimensional array of double to hold the sales

Suppose you have a two-dimensional array of double to hold the sales amounts for all your salespeople three years. Assume you employ 50 salespeople and this array already holds valid data.

  Dimensional array of integers and fill it with data

Create a 2-by-3 two-dimensional array of integers and fill it with data. Loop through the array and locate the smallest value stored. Print out the smallest value as well as its row and column position in the array

  Written a code that parses through a file reading

written a code that parses through a file reading it line by line and splitting it into tokens by white space. But I want a pair of single quotes to be one token, not how many words are in it

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