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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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