PYTHON CODE
# function to compare a and b
def compare(a,b):
# if a is greater than b , return 1
if a > b:
return 1
# if a and b are equal, return 0
elif a == b:
return 0
# if a less than b , return -1
elif a < b :
return -1
# testing
if __name__=="__main__":
# calling the compare function with a and b
print('compare(5,2) %d'%compare(5,2))
print('compare(2,5) %d'%compare(2,5))
print('compare(3,3) %d'%compare(3,3))
# getting values for a and b
a=int(input("Enter the value for a: "))
b=int(input("Enter the value for b: "))
print('compare(%d,%d) %d'%(a,b,compare(a,b)))
(see attachment for output)
Obtaining a college degree= while this is nice, you can get a lot of placed with just a GED or Highschool Degree
pursuing self-directed learning=this will help you
showing professional behavior= yes this helps a lot
setting long-term goals= this could help you in the end game
Overall, i think it would be between B and C, though C sounds correct over B because even if you pursue self directed learning, you could still get fired or quit or not get a promotion.
Answer:
Following are the code to the given question:
#include <iostream>//header file
using namespace std;
int main()//main method
{
int r=26,x,y;//defining integer variable
char c;//defining a character variable
for(x= 1; y<= r; x++)//using for loop for count value
{
for(y= 1; y<= x; y++)//using for loop to convert value in triangle
{
c=(char)(y+64);//convert value into character
cout << c;//print character value
}
cout << "\n";//use print method for line break
}
return 0;
}
Output:
Please find the attachment file.
Explanation:
In this code, three integer variable "x,y, and r", and one character variable "c" is declared, that is used in the nested for loop, in the first for loop it counts the character value and in the next for loop, it converts the value into a triangle and uses the char variable to print its character value.
Answer:
False
Explanation:
An abstract class is a class declared abstract — it may or may not include abstract techniques. It is not possible to instantiate abstract classes, but they can be sub-classed.
<u></u>
<u>Abstract method declaration</u>
abstract void moveTo(double X, double Y);
Usually the subclass offers solutions for all of the abstract techniques in its parent class when an abstract class is sub-classed. If not, however, the subclass must be declared abstract as well.
<u>Example</u>
public abstract class GraphicObject {
// declaring fields
// declaring non-abstract methods
abstract void draw();
}