PSEUDOCODE:
1. DECLARE number: INTEGER
2. DECLARE multiple: INTEGER
3. INPUT number
4. FOR counter FROM 1 TO 10 DO
5. multiple <-- number * counter
6. PRINT number, " * ", counter, " = ", multiple
7. ENDFOR
<em>1. declaring a variable "number" as an Integer</em>
<em>2. declaring a variable "multiple" as an Integer</em>
<em>3. The user inputs the value of number</em>
<em>4. FOR loop where variable "counter" increments by 1 after every iteration</em>
<em>5. sets the value for variable "multiple" as the value of number * counter</em>
<em>6. prints out for example "3 * 1 = 3" and will continue till counter reaches 10</em>
<em>7. Ends the for loop</em>
FLOWCHART below
hope it helped
Answer:
Clock (int hours, boolean isTicking, int diff) // constructor clock
{
this.hours = hours;
// set the instance variable hours
this.isTicking = isTicking;
// set the boolean variable isTicking
this.diff =diff;
//set the instance variable diff
}
Explanation:
Here we declared a constructor clock which has 3 parameter hours,boolean isTicking,and diff.
The int hours, diff is of int type and isTicking is of boolean type. In this constructor, we set the instance variables values by using this keyword.
Answer:
computer architecture is a set of rules and methods that describe the functionality, organization, and implementation of computer systems. The architecture of a system refers to its structure in terms of separately specified components of that system and their interrelationships.
Answer:
Provide requested web pages to clients; the other tasks listed there are secondary to that.
Answer:
#include <iostream>
using namespace std;
class Digits
{
public:
int num;
int read() //method to read num from user
{
cout<<"Enter number(>0)\n";
cin>>num;
return num;
}
int digit_count(int num) //method to count number of digits of num
{
int count=0;
while(num>0) //loop till num>0
{
num/=10;
count++; //counter which counts number of digits
}
return count;
}
int countDigits(int num) //method to return remainder
{
int c=digit_count(num); //calls method inside method
return num%c;
}
};
int main()
{
Digits d; //object of class Digits is created
int number=d.read(); //num is read from user
cout<<"\nRemainder is : "<<d.countDigits(number); //used to find remainder
return 0;
}
Output :
Enter number(>0)
343
Remainder is : 1
Explanation:
As program is missing to find errors , a logically write program is written to find the remainder when a number is divided by its number of digits. A class Digits is constructed which has public variable num and methods read(), digit_count(), countDigits().
- read() - This method reads value of num from the user and return num.
- digit_count() - This method takes a integer as parameter and counts the number of digits of a number passed as argument. while loop is used to increement the counter until num<0. This returns the value of count.
- countDigits() - This method takes a integer as a parameter and returns remainder when the argument is divided by number of digits of argument. Number of digits is calculated by using method digit_count().
At last in main method , object of Digits class is created and its methods are used to find the output.