Answer:
348 + 395 = 743
Hence, together they have 743 pennies and not 653 pennies. And we cannot perform the rounding, as that is the case when we have the decimal number or the float number. Only then we have the digits after the decimal. And if it's more than 5, we add 1 to the previous or else leave the number as it is. And we go on performing from right to left, and till the number of decimal places, we need to round off. However, here its purely an integer, and hence we cannot round off, as that will result in a significant loss, and which is not acceptable. However, if we want to round off before decimal places as well, then in that case 743 will be $7s, and 653 pennies will be 6+1= $7s, and if this level of loss is acceptable then we can assume that they have the same sum of money. However, here the answer is given in pennies, and hence this is not the case. And hence the answer given in the question is not correct.
Explanation:
The answer is self-explanatory. And since both are numbers, rounding is not required(as explained in the answer section), as it is required in case of decimal and float(as explained in the answer section). And as explained in the answer section, if we can tolerate very heavy loss, then the numbers as well can be rounded off as explained in the answer section. But that is not the case here, as the answer is given in pennies.
Answer:
"Desktop software" is the correct answer for the above question.
Explanation:
- Desktop software is software, which works on the computer to perform some tasks for the user of the computer. It performs the task of the user and the application.
- It is used to connect the application to the user by which the user can use any application of the computer system.
- The question wants to ask about the software which is used in the computer to connect the user and applications. So the answer is "Desktop computers" which is described above.
Answer:
twos complement value is (-2^15 -1) -32768 to 32767.
excess notation value is -32768 to 32767.
unsigned binary value is (2^16) 0 to 65535
Explanation:
Excess notation: used to represent signed integers. Always uses fixed number of bits with leftmost representing the sign.
Twos complement notation: As opposed to excess notation, a sign bit of 0 is used to represent the non-negative (+) sign and a 1 for the negative (-); again, zero is included in the non-negative set.
Unsigned Binary values: are binary values/bits that don't have signs
Add the following constants in the class definition, before the main method:
private final static float START_COST = 1.5f;
private final static float HIGH_TARIFF = 0.5f;
private final static float LOW_TARIFF = 0.25f;
private final static int FIXED_MINS = 2;
private final static int HIGH_TARIFF_MINS = 10;
Then add this to the main method you already had:
float price = START_COST;
if (x > FIXED_MINS) {
if (x <= HIGH_TARIFF_MINS) {
price += HIGH_TARIFF*(x-FIXED_MINS);
}
else {
price += HIGH_TARIFF*(HIGH_TARIFF_MINS-FIXED_MINS)
+ LOW_TARIFF*(x-HIGH_TARIFF_MINS);
}
}
System.out.printf("A %d minute call costs %.2f", x, price);
Answer:
// C++ program to demonstrate inheritance
#include <iostream>
using namespace std;
// base class
class Animal {
public:
void eat() {
cout << "I can eat!" << endl;
}
void sleep() {
cout << "I can sleep!" << endl;
}
};
// derived class
class Dog : public Animal {
public:
void bark() {
cout << "I can bark! Woof woof!!" << endl;
}
};
int main() {
// Create object of the Dog class
Dog dog1;
// Calling members of the base class
dog1.eat();
dog1.sleep();
// Calling member of the derived class
dog1.bark();
return 0;
}