Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need the output in my program to look like the white image But instead I am getting this output: This is my code: #include
I need the output in my program to look like the white image
But instead I am getting this output:
This is my code:
#include "TriangularVertices.h
#include
#include
void TriangularVertices::printTriangleint rows
for int i ; i rows; i
printSpacesBeforerows i;
printNumbersRowi;
std::cout std::endl;
if i rows
printSpacesBeforerows i;
printSlashesRowi;
std::cout std::endl;
void TriangularVertices::printNumbersRowint row
int startNumber calculateStartNumberrow;
for int i ; i row; i
std::cout std::setw startNumber i;
if i row std::cout ;
void TriangularVertices::printSlashesRowint row
std::cout std::setw; Minor adjustment to slash alignment
for int i ; i row; i
std::cout ;
void TriangularVertices::printSpacesBeforeint totalRows, int currentRow
int spaces totalRows currentRow;
for int i ; i spaces; i
std::cout ;
int TriangularVertices::calculateStartNumberint row
return row row ;
What part of the code am I doing wrong and how can I fix it
Step 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