Question
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:
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 justifiedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started