Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please help me figure out what I'm doing incorrect? I've provided a copy of the problem I'm working on right now, along with

Can someone please help me figure out what I'm doing incorrect? I've provided a copy of the problem I'm working on right now, along with the work I've done so far, and I cant seem to figure out what it is that I'm doing wrong. Been working on it for the past 3 days now but everything I've tried seems to be wrong. Please help me to learn more about strings and what is wrong with it.

Problem:

image text in transcribed

HERE IS MY WORK (Note all my work is shown for C++):

#include

#include

#include

#include

using namespace std;

int main()

{

double DensityTwo,DensityOne, J,N;

string NameOne,NameTwo;

cout

getline(cin, NameOne,' ');

N = NameOne;

cout

cin >> DensityOne;

cout

getline(cin, NameTwo,' ');

J = NameTwo;

cout

cin >> DensityTwo;

cout

cout

cout

cout

return 0;

}

C) Formatted Table: Wrnte a program to print a small formatted table showing material and densty according to the following specifications Prompt the user to enter the names of two materials and their densities. Use the densities from the table provided below. Read the material names as strings. Print 2 tables similar to the output shown below, but use lead and steel for the materials o Table 1: Use the following formatting . Left justification 12 total spaces for each item in the table Fixed format " 8 digits after the decimal point " Show trailing zeros " The table heading should also be left justified o Table 2: Use the following formatting " Right justification " 18 total spaces for each item in the table - Scientific format " 4 digits after the decimal point " Show trailing zeros " The table heading should also be right justified

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

=+1. Who will receive the final evaluation?

Answered: 1 week ago

Question

Example. Evaluate 5n+7 lim 7-00 3n-5

Answered: 1 week ago