Category : basic

I’m starting out to learn C++ and I’m a bit clueless as to what might be happening here. when I run the program and enter 2 equal inputs the int variable-result, automatically assigns itself the value, when it should not because none of the if statements are fulfilled. #include <iostream> #include <cmath> using namespace std; ..

Read more

I am a very new coder, and I’m trying to code a program that when SW1 is pressed on the Tivaware launch board, it lights the red LED and when I press both SW1 and SW2 the Blue LED is on. when I run the code shown below only the Red LED is on and ..

Read more

Write a class called boxVolume with length, width and height as data members and readData(), dispData() and computeVol() as functions. Also write a main() function to test the boxVolume class. i tried – #include <iostream> class BoxVolume { public: float length; float width; float height; void readData() { using namespace std cout << "length: "; ..

Read more