Question

• CSC 118. Programming Fundamentals C++ • Fall 2019. Dr. Ali Abu-El Humos Name: J #: 11. (8 pts)Whats wrong with the followi
0 0
Add a comment Improve this question Transcribed image text
Answer #1
The code does not handle when a <= b
So, add an else block to make it work

FIX:
------
bool Greater(int a, int b)
{
    if(a > b)
        return true;
    else
        return false;
}

Add a comment
Know the answer?
Add Answer to:
• CSC 118. Programming Fundamentals C++ • Fall 2019. Dr. Ali Abu-El Humos Name: J #:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Name Final Exam CSC 175 (Intermediate Computer Programming) Dr. David Chays May 14, 2019 You may use your own class notes, the textbook or any standard Java language reference book for this exam....

    Name Final Exam CSC 175 (Intermediate Computer Programming) Dr. David Chays May 14, 2019 You may use your own class notes, the textbook or any standard Java language reference book for this exam. Total points for this exam are 100. Problem 1 (15 pts) For a game, you are designing a World that has a collection of players. There are two kinds of players: Superhero and Jedi (i.e. a Superhero is a Player, and a Jedi is a Player) Each...

  • CIS 103 Fundamentals of Programming HW 4 CIS 103 Fundamentals of Programming HW 4 Student Name...

    CIS 103 Fundamentals of Programming HW 4 CIS 103 Fundamentals of Programming HW 4 Student Name Section Due Date Instructor Student Name Section Part A u Aaity Total 25 points 25 poins 25 points Part 3 Programning Exercises Functions 25 points 100 pons Your Scere function definition def conputeThesquare(nunberTosquare) return nunbertosquare nunberTosquare Textbook Reading Assignment Thoroughly read the Chapter(s) on Functions in your course tetbook Part 1 Glossary Terms Functions Define, in detail each of these glossary terms from the...

  • c++ U CHU PO J O ! Week 11 Homework-Functions X + /bbcswebdav/pid-2592362-dt-content-rid-39864984_1/courses/CSC-170-03-191/CSC%20170%20Program%205%20%26% CSC 170 -...

    c++ U CHU PO J O ! Week 11 Homework-Functions X + /bbcswebdav/pid-2592362-dt-content-rid-39864984_1/courses/CSC-170-03-191/CSC%20170%20Program%205%20%26% CSC 170 - 03 Fall 2019 Program 5 & 6 You are required to write a program which reads five test scores and computes and prints the sum and average of these test scores. Note: This program should not use arrays. You are required to produce two versions of this program Version 1 Program 5 In the first version you must use the following: 1. Avoid function...

  • C++ Programming QUESTION 10 Based on the following C++ code, what is the output of "pvari->print("...

    C++ Programming QUESTION 10 Based on the following C++ code, what is the output of "pvari->print(" function call? class A public void print cout << "Hello from A": 1 virtual void print2() {cout << "Hello from A2";} class B public A public void print) { cout << "Hello from B:1 virtual void print2() {cout << "Hello from B2": 1 int main() Avari Apvarl-new B; return 0; 1 o a Hello from A2 ob Hello from B O Hello from A...

  • Santa Monica College CS 20A: Data Structures with C++ Spring 2019 Name: True/False: Circle one Assignment...

    Santa Monica College CS 20A: Data Structures with C++ Spring 2019 Name: True/False: Circle one Assignment 1 ID: 1. True / False 2. True / False 3. True / False 4. True / False 5. True / False 6. True / False 7. True / False 8. True / False 9. True / False 10. True / False Variable and functions identifiers can only begin with alphabet and digit. Compile time array sizes can be non-constant variables. Compile time array...

  • Write a C/C++ program that simulate a menu based binary number calculator. This calculate shall have the following three...

    Write a C/C++ program that simulate a menu based binary number calculator. This calculate shall have the following three functionalities: Covert a binary string to corresponding positive integers Convert a positive integer to its binary representation Add two binary numbers, both numbers are represented as a string of 0s and 1s To reduce student work load, a start file CSCIProjOneHandout.cpp is given. In this file, the structure of the program has been established. The students only need to implement the...

  • Data Structures and Algorithm Analysis – Cop 3530 Module 3 – Programming Assignment This assignment will...

    Data Structures and Algorithm Analysis – Cop 3530 Module 3 – Programming Assignment This assignment will access your skills using C++ strings and dynamic arrays. After completing this assignment you will be able to do the following: (1) allocate memory dynamically, (2) implement a default constructor, (3) insert and remove an item from an unsorted dynamic array of strings, (4) use the string class member functions, (5) implement a copy constructor, (6) overload the assignment operator, (7) overload the insertion...

  • C++ Programming Hi! Sorry for all the material attached. I simply need help in writing the...

    C++ Programming Hi! Sorry for all the material attached. I simply need help in writing the Facility.cpp file and the other files are included in case they're needed for understanding. I was able to complete the mayday.cpp file but am stuck on Facility. The following link contains a tar file with the files provided by the professor. Thank you so much in advanced! http://web.cs.ucdavis.edu/~fgygi/ecs40/homework/hw4/ Closer.h: #ifndef CLOSER_H #define CLOSER_H #include <string> #include "gcdistance.h" struct Closer { const double latitude, longitude;...

  • I need to update this C++ code according to these instructions. The team name should be...

    I need to update this C++ code according to these instructions. The team name should be "Scooterbacks". I appreciate any help! Here is my code: #include <iostream> #include <string> #include <fstream> using namespace std; void menu(); int loadFile(string file,string names[],int jNo[],string pos[],int scores[]); string lowestScorer(string names[],int scores[],int size); string highestScorer(string names[],int scores[],int size); void searchByName(string names[],int jNo[],string pos[],int scores[],int size); int totalPoints(int scores[],int size); void sortByName(string names[],int jNo[],string pos[],int scores[],int size); void displayToScreen(string names[],int jNo[],string pos[],int scores[],int size); void writeToFile(string...

  • COSC 112 Test #3 Spring 2019 20. It is not necessary to specify the parameter name...

    COSC 112 Test #3 Spring 2019 20. It is not necessary to specify the parameter name in the parameter list of a function prototype even 21. Which of following is not a situation when reference parameters are useful? though there is a default parameter. (True/False) a. When you don't want to have side effects b. When you need to change the actual parameter c. When you need to return more than one value d. When you want to save memory...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT