Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C/C++ syntax programming Write a function that prompts and reads the x and y coo

ID: 3657836 • Letter: C

Question

C/C++ syntax programming Write a function that prompts and reads the x and y coordinates of the bottom left corner of a rectangle. The function has return type of void. It has three input param- eters. A string that holds the prompt that asks for user input. A double for passing back the entered x coordinate. A double for passing back the entered y coordinate. This function is used in steps (vi) and (xv). Write a function that prompts and reads the length and height of a rectangle. The function has return type of void. It has three input parameters. A string that holds the prompt that asks for user input. A double for passing back the length. A double for passing back the height. This function should continue prompting the user until positive values are ented for both values. Use this function in steps (vii) and (xvi).

Explanation / Answer

/* Bottle - Class and Object Example */ #include #include using namespace std; class Bottle { private: // variables are modified by member functions of class int iFill; // dl of liquid public: Bottle() // Default Constructor : iFill(3) // They start with 3 dl of liquid { // More constructor code would go here if needed. } bool sip() // return true if liquid was available { if (iFill > 0) { --iFill; return true; } else { return false; } } int level() const // return level of liquid dl { return iFill; } }; // Class declaration has a trailing semicolon int main() { // terosbottle object is an instance of class Bottle Bottle terosbottle; cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote