Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

2 Endorsements
Ranked #621
~14.2K People Reached
Favorite Forums
Favorite Tags
Member Avatar for andrew mendonca

C++ Programming Exercise: Implement a command-line calculator that allows the user to enter an expression containing numbers, variables, brackets, and operators. The calculator will also allow assignments to a variable. After the user enters the expression the program will evaluate it and display the value. If the expression is part …

0
127
Member Avatar for andrew mendonca

I am trying to write this recursive function: void printFactors(int n) For this function, I need to print prime factors in ascending order. e.g. for n = 24 the output would be 2 2 2 3. I cannot use loops and static variables for this function. Here is my solution: …

Member Avatar for tinstaafl
0
215
Member Avatar for andrew mendonca

I'm trying to write the function: int sum(int x, int y) For this function, I need to return sum of m and n using only increment, decrement and unary -. m and n can be any integers e.g. if m is 4 and n is -5, the return value would …

Member Avatar for rubberman
0
140
Member Avatar for andrew mendonca

I am trying to create a recursive function: double fifthRoot(double x, double maxError) In this function, I have to return y such that y^5 will be within maxError of x. Assume x > 0. Also assume maxError is big enough to prevent problems due to rounding. In order to make …

Member Avatar for sfuo
0
311
Member Avatar for andrew mendonca

Define a C-string function void append(const char * v, const char * w, char * buffer) that appends the characters of C-string w to the characters of C-string v and stores the result in buffer. (Don't forget the terminating null character .) You can assume that the function is called …

Member Avatar for uonsin
0
402
Member Avatar for andrew mendonca

Define a function string sort(string s) that returns a string with the same characters as s, but arranged in ascending order, according to ascii value . For example sort("hello") will return the string "ehllo". Notice that the function returns a different string from the original argument, since s is not …

Member Avatar for Moschops
0
186
Member Avatar for andrew mendonca

Write a function int findLast(string words[], int numWords, string target) that returns the index of the last occurence of target in words or -1 if there is no occurrence. Remember: you can compare string objects using ==, these are NOT C-strings ! Here is my solution: int findLast(string words[], int …

Member Avatar for rubberman
0
351
Member Avatar for andrew mendonca

For this programming exercise, you may use ONLY these instructions: and nor or ori sll srl xor Start a program with the instruction that puts a single one-bit into the low order bit of register eight ($8 or $t0): ori $t0, $0, 0x01 Now, by using only shift logical instructions …

0
214
Member Avatar for andrew mendonca

For this programming exercise, you may use ONLY these instructions: and nor or ori sll srl xor Run the programs by verifying the value of the PC is 0x00400000 (right-click the field and use Change Register Contents to set it) and then single stepping (pushing F10) and observing the results …

0
128
Member Avatar for andrew mendonca

Define a function named isDivisor that has two parameters of type int and returns a value of type bool. A call to isDivisor(m,n) should return true if and only if (iff) m divides n. For example isDivisor(6,24) will return true but isDivisor(5,24) will return false . Note that every number …

Member Avatar for chriswelborn
0
319
Member Avatar for andrew mendonca

Define a function int getRoots(double a, double b, double c, double & s1, double & s2) that solves a quadatic equation with coefficients a, b and c. If there are no real roots than the return value will be 0 and the values of s1 and s2 will be left …

0
128
Member Avatar for andrew mendonca

Define a function void order(int & a, int & b, int & c, bool ascending) that places the values in ascending or descending order, depending on whether the last parameter is true or false . For example, if x, y and z contain the values 3,1, and 2, respectively, then …

Member Avatar for ryantroop
0
224
Member Avatar for andrew mendonca

Define a function bool isWin(char board[][3], char target); that returns true if character target has a winning position on this tic-tac-toe board. That means three occurences of target in a line, column or along either diagonal. For example if target is 'O' and if board[0][2], board[1][1] and board[2][0] all equal …

Member Avatar for Moschops
0
285
Member Avatar for andrew mendonca

Write a complete program that reads an integer k > 1 from the console and finds the first positive natural number n hat is divisible by all whole numbers between 2 and k inclusive. Your program may only use do-while loops , even if you think a for-loop or while …

Member Avatar for Hiroshe
0
364
Member Avatar for andrew mendonca

Write a complete program that reads three integers from the console and outputs the number of distinct values entered. For example if the input is 34 55 23 then the output will be 3, since there are three distinct values . If the input is 42 78 42 then the …

Member Avatar for Suzie999
0
281
Member Avatar for andrew mendonca

Your Math class has five 100 point tests over the course of a semester (and nothing else that counts toward your grade). In addition to getting an average score of 70/100 you must pass at least three individual tests in order to pass the class . For example, if your …

Member Avatar for Taywin
0
520
Member Avatar for andrew mendonca

Without using arrays, write a complete program that reads three integers from the console and outputs the same three numbers in ascending order on separate lines. For example if the input is 5 4 3 then the output will be 3 4 5. Do not prompt the user or produce …

Member Avatar for Taywin
0
3K
Member Avatar for andrew mendonca

Working on the maze program, with '*' indicating a wall, ' ' indicating a corridor, and '#' indicating a solution path, where I must use a recursive backtracking algorithm, I cannot seem to print the '#' symbol for the solved maze. Here is my new code: #include<iostream> #include<fstream> using namespace …

Member Avatar for kal_crazy
0
249
Member Avatar for andrew mendonca

For the maze program, with '*' indicating a wall, ' ' indicating a corridor, and '#' indicating a solution path, where I have to use a recursive backtracking algorithm, I am still having trouble print the maze solution. Here is the unsolved maze: 8 12 ********** * * * * …

Member Avatar for kal_crazy
0
310
Member Avatar for andrew mendonca

In this program, I am trying to print a solution for the maze with '*' indicating a wall, ' ' indicating a corridor, and '#' indicating a solution path. I am using a recursive backtracking algorithm in this program. For instance, here is a small (8-by-12) maze: 8 12 ********** …

Member Avatar for kal_crazy
0
1K
Member Avatar for andrew mendonca

Write a program to read a maze from a text file into your array, print the unsolved maze, solve the maze, and then print the solution. You may assume the maze will fit in a 24-row by 81-column character array (for 80 character C-strings). The maze will be in a …

Member Avatar for owenransen
0
1K
Member Avatar for andrew mendonca

Write a program to read a maze from a text file into your array, print the unsolved maze, solve the maze, and then print the solution. You may assume the maze will fit in a 24-row by 81-column character array (for 80 character C-strings). The maze will be in a …

Member Avatar for owenransen
0
524
Member Avatar for andrew mendonca

Here is the website for the assignment: http://www.docdroid.net/6ap6/inheritance5.pdf.html Note: The ones highlighted in blue are the ones I completed, and the ones highlighted in yellow are the ones I need help with. Here is the website for the first header file (point.h): http://ideone.com/6bAeqv Here is the website for the first …

Member Avatar for richieking
0
203
Member Avatar for andrew mendonca

CSCI-15 Assignment #4, operator functions/methods. 25 points. Due 11/6/2013 Extend your class MixedExpression class to include operator methods for addition, subtraction, multiplication and division, and to have friend operator << and operator >> functions for reading and printing the MixedExpression objects. Allow cascaded input and output per the << and …

Member Avatar for Ancient Dragon
0
241
Member Avatar for andrew mendonca

Here is the website for the assignment I am working on: http://view.samurajdata.se/rsc/5c1dd0b4/ Here is the website for my header file (MixedExpression.h): http://ideone.com/G9aC9D Here is the website for my library source file (MixedExpression.cpp): http://ideone.com/PfH8f0 Here is the website for my calculator client file (Calculator.cpp): http://ideone.com/4wGayu Here are the input lines: ( …

Member Avatar for Banfa
0
214
Member Avatar for andrew mendonca

Here is the website for the assignment I am working on: http://view.samurajdata.se/rsc/5c1dd0b4/ Here is the website for my header file (MixedExpression.h): http://ideone.com/oJ6mI8 Here is the website for my library source file (MixedExpression.cpp): http://ideone.com/inEyqe Here is the website for my calculator client file (Calculator.cpp): http://ideone.com/EDTWeS The header file is correct. I …

Member Avatar for rubberman
0
204
Member Avatar for andrew mendonca

Here is the website for the assignment I am working on: http://view.samurajdata.se/rsc/5c1dd0b4/ Here is the website for my header file (MixedExpression.h): http://ideone.com/oJ6mI8 Here is the website for my library source file (MixedExpression.cpp): http://ideone.com/RSrshS Here is the website for my calculator client file (Calculator.cpp): http://ideone.com/U5F2O8 My question: I got the code …

Member Avatar for Schol-R-LEA
0
150
Member Avatar for andrew mendonca

The local baseball team is computerizing its records. Write a program that computes batting averages and other statistics. There are 20 players on the team, identified by the player ID 1 through 20. You will have two input files: roster.txt and statistics.txt 1) The Roster File (roster.txt) - This file …

Member Avatar for andrew mendonca
0
364
Member Avatar for andrew mendonca

Assignment 9, Due Dec 2 Design and implement a program that allows the user to keep track of students in a college course. The program will function as a simple database in which students can be inserted, removed and updated. Additionally, the user can display students in order by name …

Member Avatar for andrew mendonca
0
210
Member Avatar for andrew mendonca

Define a getTopTwoScores() function with the specification and prototype shown below: // Set highest to the score with highest value and secondHighest to the score with the next highest value. // If there are two highest scores with the same value then set both highest and secondHighest to that value. …

Member Avatar for nullptr
0
196