<< Prev Showing: 231-235 of 353 Next >>
· 206-210 · 211-215 · 216-220 · 221-225 · 226-230 · 231-235 · 236-240 · 241-245 · 246-250 · 251-255 · 256-260 ·Write a C++ value returning function that implements the recursive formula F(n) = F(n-1) + F(n+2) with base cases F(0)=1 and F(1) =1
Subject:
Computer Science
Topic:
Data Structures and Algorithms
Posting ID:
130834
OTA ID:
103987
Write a C++ program to output the binary (base-2) representation of a decimal integer. The algorithm for this conversion is to be repeated dividing the decimal number by 2 until it is 0. Each division produces a remainder of 0 or 1 which becomes a digit in the binary numbers. example the decimal number 25 25/2 = 12 remainder 1 12/2 = 6 remainder 0 6/2 = 3 remainder 0 3/2 - 1 remainder 1 1/2 = 0 remainder 1
Subject:
Computer Science
Topic:
Data Structures and Algorithms
Posting ID:
130836
OTA ID:
101298
Write a program that read in an integer. If the integer is a negative number, catch the exception and print an error message "Invalid Integer: value negative" and prompt the user for another number. If the integer is zero, catch the exception and print a message, "Integer cannot be zero, and end the program. Otherwise, just print the value of the integer.
Subject:
Computer Science
Topic:
Data Structures and Algorithms
Posting ID:
130860
OTA ID:
101298
Give the class declaration class point { public: int xcoordinate(); int ycoordinate(); point(in initializeX, in initialize Y); private: int x; int y; }; 1: Suppose we have a type declaration as follows: enum status {on, off}; declare a class Pixel that inherits from class Point. Class Pixel will have an additional data member of type Status name Statustype; it has its own constructor that recieves three parameters. 2. write cleint statements that creates Pixel objects, FirstPixel with an initial (x,y) position of (5,9) and status OFF 3.Write client code to print out the current X and coordiantes and the status of the first pixel 4. Write the function definit... click for more
Subject:
Computer Science
Topic:
Data Structures and Algorithms
Posting ID:
130862
OTA ID:
101298
The following class uses composition to define a line object in terms of two point objects. class line { public: Point startingpoint(); point endingpoint(); float length(); line (int startX, int startY, int endX, int endY); private: point startPoint; point endPoint: }; 1) write a fucntin defintion for the Line class constructor 2) for the line class implement the StartingPoint() and EndingPoint() member functions 3) for the line class implement the lenght() member function. the distance between two points (x1,y1) and (x2,y2) is sqrt ((x1,x2)2 + (x2,y2)2)
Subject:
Computer Science
Topic:
Data Structures and Algorithms
Posting ID:
130872
OTA ID:
101298
<< Prev Showing: 231-235 of 353 Next >>
· 1-5 · 6-10 · 11-15 · 16-20 · 21-25 · 26-30 · 31-35 · 36-40 · 41-45 · 46-50 · 51-55 · 56-60 · 61-65 · 66-70 · 71-75 · 76-80 · 81-85 · 86-90 · 91-95 · 96-100 · 101-105 · 106-110 · 111-115 · 116-120 · 121-125 · 126-130 · 131-135 · 136-140 · 141-145 · 146-150 · 151-155 · 156-160 · 161-165 · 166-170 · 171-175 · 176-180 · 181-185 · 186-190 · 191-195 · 196-200 · 201-205 · 206-210 · 211-215 · 216-220 · 221-225 · 226-230 · 231-235 · 236-240 · 241-245 · 246-250 · 251-255 · 256-260 · 261-265 · 266-270 · 271-275 · 276-280 · 281-285 · 286-290 · 291-295 · 296-300 · 301-305 · 306-310 · 311-315 · 316-320 · 321-325 · 326-330 · 331-335 · 336-340 · 341-345 · 346-350 · 351-353 ·Page generated in 0.0965 seconds