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, Computer Software Engineer
Category: Programming
Satisfied Customers: 13171
Experience:  Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.
29751445
Type Your Programming Question Here...
LogicPro is online now
A new question is answered every 9 seconds

1 Write a statement to find the remainder rem when num is divided

This answer was rated:

1 Write a statement to find the remainder rem when num is divided by 5. (The variables have already been declared and num has already been initialized.)

2 Given an int variable datum that has already been declared, write a statement that reads an integer value from standard input into this variable.

3 Assume that name has been declared suitably for storing names (like "Misha", "Emily" and "Sofia") Write some code that reads a value into name then prints the message "Greetings, NAME" where NAME is XXXXX XXXXX value that was read into name.
For example, if your code read in "Rachel" it would print out "Greetings, Rachel".

4 Write a complete program that
declares an integer variable,
reads a value from the keyboard into that variable, and
writes to standard output the square of the variable's value.
Besides the number, nothing else should be written to standard output.

5 Declare a string named line and write a statement that reads in the next line of standard input into this array.


6 The length of a rectangle is stored in a double variable named length , the width in one named width . Write an expression whose value is the length of the diagonal of the rectangle.

Given an integer variable count, write a statement that writes the value of count to standard output. (When we say "given", that means that count has ALREADY been declared-- so you should not declare it!)

7 Do not write anything else to standard output -- just the value of count. In particular, your output should NOT include something like "count=". The output should be JUST the value of the variable count.
Hi,
What is the deadline?
Customer: replied 6 years ago.
11:59 pm
I will try to provide the answer ASAP. Please wait.
Customer: replied 6 years ago.

are you going to answer all 8 questions?

 

I see only 7 questions.
(Edited by Moderator)
Customer: replied 6 years ago.
there is a question between 6 and 7 that i missed numbering
Ok. Please wait. I will provide the answer ASAP

Answer 1:

 

int rem;

rem=num%5;

 

LogicPro and other Programming Specialists are ready to help you
Answer 2:

int datum;
cout<<"Enter a number: ";
cin>>datum;

Asnwer 3:

string name;
cout<<"Enter a name: ";
cin>>name;
cout<<"Greetings, "<<name;
Answer 4:

#incldue<iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter a number: ";
cin>>num;
cout<<num*num;
system("pause");
return 0;
}
Customer: replied 6 years ago.
I havent had time to check them all
No worries.
I am providing the working answers.
Answer 4:

#include<iostream>
using namespace std;
int main()
{
int num;
cout<<"Enter a number: ";
cin>>num;
cout<<num*num;
system("pause");
return 0;
}
Customer: replied 6 years ago.
yes the first two have been right so far
Thank you.
For answer 4, consider the second one.
There is a spelling mistake in the first one.
Answer 5:

#include<iostream>
#include<string>
using namespace std;
int main()
{
string str;
cout<<"Enter a line: ";
getline(cin,str);
cout<<endl<<str;
system("pause");
return 0;
}
Answer 6:

double diagonal=sqrt((length*length)+(width*width));
Answer 7:

cout<<count;
Customer: replied 6 years ago.
it is not accepting answer 3
Try again now.
Customer: replied 6 years ago.

ok i just got 2 left

Customer: replied 6 years ago.
Declare a string named line and write a statement that reads in the next line of standard input into this array.....this needs to just be one statement not a program
Here is the statement
string line;getline(cin,str);

Following is one question:

Given an integer variable count, write a statement that writes the value of count to standard output. (When we say "given", that means that count has ALREADY been declared-- so you should not declare it!)
7 Do not write anything else to standard output -- just the value of count. In particular, your output should NOT include something like "count=". The output should be JUST the value of the variable count.
Customer: replied 6 years ago.
its not accepting it
What happens when you try to accept.
Customer: replied 6 years ago.
it is saying something is wrong with the str
You can logout and login again and try
Or send an email to info @ justanswer.com with the amount you want to pay.
Customer: replied 6 years ago.

is there anything that could go in the place of str, thats the only part it doesn't like

 

Oh,
I got it.
I apologise
Here is the statement
string line;getline(cin,line);
Customer: replied 6 years ago.
thank you so much!
You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant and fresh answers. Please leave a positive feedback and ask me if you need more information.