Answer:
Explanation:
The program in question would create a new Scanner Object which asks the user for the Username first. It would then save this input into a temporary variable and compare it to the actual username in the database. Since the username is not case sensitive, we would use the toLowerCase() method on both the input and the database username so that they match even if the letters are not the same case structure. If both usernames match then we would move on to ask the user for the Password and compare it with the database password for that user. Since this one is case sensitive we would compare as is. Finally, if both Username and Password match we would print "Hello World" otherwise we would print "Login Failed."
I don’t really understand what you are trying to ask. Try posting a picture along with your question
Answer:
<em>C++</em>
////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v;
int n = 1;
while (n != 0) {
cout<<"Enter an integer, the input ends if it is 0: ";
cin>>n;
v.push_back(n);
}
cout<<endl;
///////////////////////////////////////////////////////////
int sum = 0;
int num_positives = 0, num_negatives = 0;
for (int i=0; i<v.size()-1; i++) {
if (v[i] > 0)
++num_positives;
else
++num_negatives;
sum = sum + v[i];
}
//////////////////////////////////////////////////////////
cout<<"The number of positives is "<<num_positives<<endl;
cout<<"The number of negatives is "<<num_negatives<<endl;
cout<<"The total is "<<sum<<endl;
cout<<"The average is "<<(float)sum/(v.size()-1);
///////////////////////////////////////////////////////////
return 0;
}
Answer:
Programmers can take advantage of abstraction to focus on specific tasks.
Explanation:
When we excel in some subjects, we can do abstraction in that subject. Abstraction means you understand by the term, and you do not need details of that term. Like you say some tasks will be done by a graphic designer as a project manager, and you do not need to understand at that point what he will be doing, and that is because you can write in a word or few what is going to be the outcome. And hence, the programmers can take advantage of abstraction to focus on specific tasks. And this is the correct option.