(TCO 7) Create an output format statement which would generate lines in the tabl
ID: 655215 • Letter: #
Question
(TCO 7) Create an output format statement which would generate lines in the table which appear as shown below. The Element Name Field displays an element name contained in the name variable. YYY displays an integer value from the anumvariable which ranges from 1 thru 109 and should be left justified. XXX.XXXX displays an atomic weight value from the aweight variable which ranges from 1.0000 to 268.0000 and should be right justified. Use the variables shown below in your output statements.
Element Name Field..YYY....XXX.XXXX
char name[15]; int anum; double aweight;
**Note In c++
Explanation / Answer
int main()
{
cout.width(15);
cout<<Name;
cout.setf (ios::left);
cout.width(10);
while (anum <=1 && anum>=109)
cout<<anum;
cout.setf(ios::right);
cout.width(10);
while (aweight >=1.000 && aweight<=268.000)
cout<<aweight;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.