How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask LogicPro Your Own Question

LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 9350
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
Type Your Homework Question Here...
LogicPro is online now
A new question is answered every 9 seconds

Hello,Just wondering if anyone was available to help with

Customer Question

Hello,

Just wondering if anyone was available to help with 25 multiple choice questions.
Submitted: 1 year ago.
Category: Homework
Expert:  FiveStarLaw replied 1 year ago.

FiveStarLaw :

I may be able to assist you. What is the subject matter

JACUSTOMER-66nsdafm- :

computer programming

FiveStarLaw :

I do not tutor in computer programming. I shall opt out so that another expert can assist you

JACUSTOMER-66nsdafm- :

ok thanks

Customer:

is anyone available in computer programming

Expert:  Carla replied 1 year ago.
I might be able to help.

Do you have the link for me to download the questions?


Thank you
Customer: replied 1 year ago.


Hello,


 


I can paste the questions here if you like.

Expert:  Carla replied 1 year ago.
I would prefer if you could upload the questions in a document to wikisend.com and then paste the download link here.

Thank you
Customer: replied 1 year ago.


Ok, I will try.

Customer: replied 1 year ago.


Are you online right now

Expert:  Carla replied 1 year ago.
Sorry, I was not online when you posted the above message.

You can post the download link at any time you want and I will take a look the first time I come online.


Thank you
Customer: replied 1 year ago.


Ok I also wanted to make sure you were online because its a time restraint on the questions. Could you please let me know when your online so I can post the questions.


 


Thanks

Expert:  Carla replied 1 year ago.
Ah ok. In that case you will need to let me know what sort of questions they are.

You mentioned that they are programming questions. What programming language is this for?
Customer: replied 1 year ago.


Hello,


 


They are High level programming questions:


 


Example questions are as follows: Only sample questions


 








1. What is the result of 57 % 8? (Points : 1)

1 7 7.125 8








if(var < 0 && var > 50) if(var < 0 else var > 50) if(var <= 0 || var >= 50) if(var < 0 || var > 50)














3. How many times does the following loop execute? (Points : 1)

365 50 51 Indefinite, it is an infinite loop.














4. What is the output for the following code fragment? (Points : 1)

1920 1919 2020 2021














5. A variable declared within a block is visible _____. (Points : 1)

from the point of declaration onward to the end of the function from the point of declaration onward to the end of the block from the point of declaration onward to the end of the program throughout the entire program














6. Assign the value 123.4 to the element in the 6th row and 4th column of data. (Points : 1)

data[6][4] = 123.4; data[4][6] = 123.4; data[5][3] = 123.4; data[3][5] = 123.4;














7. What does the following code do? (Points : 1)

It calculates the average of the contents of the data array. It calculates the sum of the contents of the data array. It calculates the sum of the elements of the even rows of the data array. It calculates the sum of the elements of the even columns of the data array.














8. The following code fragment _____. (Points : 1)

causes a compiler error causes a run-time error copies both p1’s name and rbi to p2 copies only p1’s name to p2














9. What is the output of the following code? (Points : 1)

1 2 n values unknown














10. Which of the following function definitions uses pass-by-value? (Points : 1)

int myFunc( int * x, int * y ); int myFunc( int x, int y ) ; int myFunc( int & x, int & y ) ; int myFunc( int @value1, int @value2 ) ;














11. Which of the following techniques can be used by a function to return two results to the calling function? (Points : 1)

Use two return statements: return ( value1 ); return ( value2 ); Use one return statement with two values: return ( value1, value2 ); Use two reference parameters and assign the two results to those reference parameters. Not allowed in C++.














12. Given the following method definition for some class, this method is declared so: (Points : 1)

the method cannot write to the passed parameter. the method cannot write to the data members of the class to which it belongs. the method cannot read the data members of the class to which it belongs. All of the above














13. Given the following class definition and lines of code, Line 1 in main is a call to what? (Points : 1)

The 0-argument Distance constructor. The 2-argument, int, double, Distance constructor. The 2-argument, double, int, Distance constructor. The 1-argument, int, Distance constructor.














14. For the following declaration, how many constructors does class xClass have? (Points : 1)

0 1 2 3














15. When organizing a program into three files (main, class implementation, and class header), what line(s) are required in the main program file? (Points : 1)















16. A derived class that uses private for its inheritance access specifier _____. (Points : 1)

has direct access to public members of the parent class has direct access to private members of the parent class cannot have private data members has direct access to both public and private members of the parent class














17. Assume that Time is a class. Which is a valid statement to assign a new value to pTime? (Points : 1)

pTime = t1; pTime = *t1; pTime = &t1; pTime = #t1;














18. Which of the following statements correctly allocates space to store 17 real numbers? (Points : 1)

double *dptr = new double[17]; double dptr = new double[17]; double *dptr = new double[16]; real *iptr = new real[17];














19. Given a pointer variable called myData that points to an instance of the following structure, which of the following statements assigns the value ‘C’ to the cval field of the structure? (Points : 1)

cval = ‘C’; *mydata = ‘C’; mydata->cval = ‘C’; mydata.cval = ‘C’;














20. Which of the following code fragments would create a String that contains the value of a double variable called value, limiting the output to 4 digits following the decimal point? (Points : 1)

String str = new String(value, 4); String str = String.format(“%.4f”, value); String str = printf(“%.4f”, value); String str = Double.toString(value);














21. In order to handle an event from someone pressing the enter key in a JTextField object field1, what does a programmer need to do? (Points : 1)

Create a nested inner class that implements the ActionListener interface. Create an object of the nested inner class as the event handler object. Invoke the addActionListener method on field1 to register the event handler object with the text field. All of the above.














22. What can you say about the following Java class definition? (Points : 1)

This class is illegal because it is using inheritance and implementing an interface at the same time. MyApp is using inheritance to create a customized JFrame based application which handles ItemEvents. This class will need to use an object of some other class which provides the itemStateChanged method. None of the above














23. What can you say about the following Java class? (Points : 1)

MyApp will contain methods from both the JFrame and JPanel classes. MyApp will not compile because multiple inheritance is illegal in Java. MyApp inherits from JFrame and implements the JPanel interface. MyApp is allowed to implement both the JFrame and JPanel interface.














24. Assume that the display variable below is a JTextField object. What does the following code do? (Points : 1)

Converts the display object to an integer value and stores it in num. Gets a textbook from the user, converts its ISBN number to a double, and stores it in num. Searches for the word “Integer” in the string that the user entered in display, and stores its position in the num variable. Fetches the string the user typed in the display text field, converts it to an integer, and stores the result in the num variable.














25. What is the result of the following code? (Points : 1)

Two buttons are added side by side at the top of the display. Button One was added first, so it is the only button at the top of the display. Button Two was added last, so it is the only button at the top of the display. The Java compiler will not allow you to add two buttons to the same area.


 


Expert:  Carla replied 1 year ago.
Right, thanks. I won't be able to help with that but I will send these questions to an Expert in Java.

Hopefully he will be able to help you. You will be notified when he replies.

Thank you
Expert:  LogicPro replied 1 year ago.
Hi,
My name is XXXXX XXXXX I will help you.

If you have any file(s), Zip all files, upload the zipped file to http://wikisend.com and post download link here. Formatting is messed up.

What is the deadline?
Customer: replied 1 year ago.


Hello,


 


I will only have 2 hours.

Expert:  LogicPro replied 1 year ago.
Paste all your questions in a word document, and upload the document to www.wikisend.com and paste download link here.

Customer: replied 1 year ago.


Ok

Expert:  LogicPro replied 1 year ago.
ok
Customer: replied 1 year ago.


Hello is it possible just to attach the file here because for some odd reason it will not allow me to do so in wikisend

Expert:  LogicPro replied 1 year ago.
In the text window, use the paper clip icon to attch the file
Customer: replied 1 year ago.



access was denied to me

Expert:  LogicPro replied 1 year ago.
On the reply page, in the text window, use the paper clip icon to attch the file.

Or try http://ge.tt to attach the file.
Customer: replied 1 year ago.

Well just in case you can start on this here are the questions and Im working on attaching the file.


 


 
















2. (TCO 2) What is the value of data after the following code executes?
unsigned char data = 0xA5;
data = data & 0xF0;



0xA0
0xF0
0xF5
0x5A



 
















3. (TCO 2) Which of the following is not a C++ logical operator?



#
&&
„„
!



 
















4. (TCO 2) What is the final number output for the following code snippet?
for (i = 1 ; i <= 20 ; i = i + 2);
cout << “ “ << i ;



10
19
20
Illegal set-up of for loop parameters



 
















5. (TCO 2) What is the result of 5 % 7?



0
2
5
7



 
















6. (TCO 2) Given the following code to fill an array,
int X;
int data[100];
for(int i = 0; i <= X; i++)
data = i;
What should the value of X be?



100
101
99
i



 
















7. (TCO 2) Given the following code fragment, what is the data type of roster[9] .name?

struct student
{
string name;
double gpa;
};
student thisStudent;
student roster[50];



string
const pointer to student
student
double



 
















8. (TCO 2) What is the data type of bullpen[3].era?
struct pitcher
{
string name;
double era;
};
pitcher p1;
pitcher bullpen[10];



string
double
pitcher
const pointer to pitcher



 
















9. (TCO 2) When a variable is passed by reference:



the variable can be changed by the calling and the called function
the parameter name is XXXXX XXXXX of the variable passed
the called function can change the value of the variable in the calling program
All of the above



 
















10. (TCO 2) What is the output of the following code?
void func(int x[ ])
{
x[0] = x[0] * 3;
x[1[ = x[1] * 3;
x[2] = x[2] * 3;
}
Int main ()
{
int x[ ] = {1, 2, 3};
func(x);
cout << x[0] << “ “ << x[1] << “ “ << x[2] << endl;
}



1 2 3
3 4 5
3 6 9
3 3 3



 
















11. (TCO 2) Which of the following statements calls the following function correctly?
int MultiplyValues (int, int);



int a = MultiplyValues (int x, int y);
int a = MultiplyValues (10, 20);
double d = MultiplyValues (int 10, int 20);
All of the above



 























1. (TCO 2) When organizing a program into three files (main, class implementation, and class header), which is not a .cpp file?




main
none are .cpp
class header
class implementation



 
















2. (TCO 2) Which of the following is called automatically each time an object is created?




Compiler
Builder
Constructor
Destructor



 
















3. (TCO 2) Given the following class definition and lines of code, Line 1 in main is a call to what?
class Distance
{
private:
int feet;
double inches;
public:
Distance( );
Distance(int initFt, double initIn);
void setFeet(int feetIn);
void setInches(double inchesIn);
int getFeet() const;
double getInches( ) const;
};
int main( )
{
Distance d1; //Line 1
const int MAX = 100; //Line 2
Distance list[MAX]; //Line 3
Distance d2(1, 2.3); //Line 4
Distance * pDist; //Line 5
d1.feet = 5; //Line 6
// etc. – assume the remaining code is correct
}




The 0-argument Distance constructor.
The 2-argument, int, double, Distance constructor.
The 2-argument, double, int, Distance constructor.
The 1-argument, int, Distance constructor.



 
















4. (TCO 2) Creating one class from another in a parent/child hierarchy is an example of:




encapsulation
polymorphism
inheritance
abstraction



 
















5. (TCO 2) Given the following class definition and lines of code, what would be displayed if Line 6 were replaced by: cout << d2.getFeet() << endl;
class Distance
{
private:
int feet;
double inches;
public:
Distance( );
Distance(int initFt, double initIn);
void setFeet(int feetIn);
void setInches(double inchesIn);
int getFeet() const;
double getInches( ) const;
};
int main( )
{
Distance d1; //Line 1
const int MAX = 100; //Line 2
Distance list[MAX]; //Line 3
Distance d2(1, 2.3); //Line 4
Distance * pDist; //Line 5
d1.feet = 5; //Line 6
// etc. – assume the remaining code is correct
}




0
1
2.3
5



 
















6. (TCO 2) Which of the following is not a legal value to initialize a pointer variable?




zero
null
0
the address of a variable of the same type



 
















7. (TCO 2) Given a class called Employee and the following definitions and statements:
void myFunction (Employee * eptr);
Employee emp;
Which of the following statements correctly calls the function passing in the address of the data array?




myFunction(emp);
myFunction(&emp);
myFunction(*emp);
myFunction(**emp);



 
















8. (TCO 2) What is the output of the following code snippet?
int value = 10;
int * iptr = &value;
*iptr = 5;
Cout << *iptr << “ “ << value;




5 5
10 10
5 10
10 5



 
















9. (TCO 2) What Java package contains the definitions of the Java event listener interfaces?




java.events
javax.GUI.events
java.awt.event
java.event.listener



 
















10. (TCO 2) Which Java interface would you need to implement in order to handle events such as key pressed or key released events?




KeyListener interface
KeyStroke interface
KeyEvent interface
This information is not available in a Java program



 
















11. (TCO 2) What range of numbers does the following expression generate?
Int num = 1 + (int) (Math.Random ( ) * 100);




minimum is 0, maximum is 100
minimum is 1, maximum is 101
minimum is 1, maximum is 100
minimum is 1, maximum is 101



 
















12. (TCO 2) In the following Java code, the tfield variable is defined to be a JTestField. What data type must the input variable be declared as?
Input = tfield.getText( );




Double
Integer
String
String [ ]



 
















13. (TCO 2) The x, y drawing coordinate system used in Java graphics




uses character units.
has the origin in the upper left corner of the display area.
uses the x coordinate for the vertical axis.
All of the above



 
















14. (TCO 2) What is the result of the following code?
JFrame frame = new JFrame( );
frame.add(new JButton(“One”), BorderLayout.NORTH);
frame.add(new JButton(“Two”), BorderLayout.NORTH);
frame.setVisible(true);




Two buttons are added side by side at the top of the display.
Button One was added first, so it is the only button at the top of the display.
Button Two was added last, so it is the only button at the top of the display.
The Java compiler will not allow you to add two buttons to the same area.



 



 

Expert:  LogicPro replied 1 year ago.
ok..
Customer: replied 1 year ago.

Is this the link you need in ge.tt


 


http://ge.tt/8O2H9oj/v/0

Expert:  LogicPro replied 1 year ago.
yes, please wait.
Expert:  LogicPro replied 1 year ago.
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
LogicPro, Engineer
Category: Homework
Satisfied Customers: 9350
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
LogicPro and 6 other Homework Specialists are ready to help you
Customer: replied 1 year ago.


Hello,


 


Thanks so much for your help. I will definitely give a excellent rating!!!


 


I was also wondering if you had time for another 25 multiple choice questions with an time restraint.

Expert:  LogicPro replied 1 year ago.
Thank you.
I would be happy to help you with your other questions also.

For the next multiple choice questions, please post a new question using "For LogicPro only" at the start of the question text. It will ensure question comes to me.
Customer: replied 1 year ago.


ok cool so I will rate these questions and start a new question.


 


Thanks

Expert:  LogicPro replied 1 year ago.
Welcome
Customer: replied 1 year ago.

 


Hello LogicPro,


Just wondering if you had time to answer questions on programming with a time restraint.


Thanks

Expert:  LogicPro replied 1 year ago.
ok. please post a new question using "For LogicPro only" at the start of your question.
It will ensure that question is for me.
goto my profile page:
http://www.justanswer.com/homework/expert-logicpro/
to create a new question.
Customer: replied 1 year ago.


ok cool


 


 

Expert:  LogicPro replied 1 year ago.
thanks

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience