answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
xenn
20 days ago
13

Rewrite following program using for loop no=3456 while no>0 : print(no%10) no=no/10

Computers and Technology
2 answers:
zubka84 [942]20 days ago
8 0
no=3456 for x in reversed(str(no)): print(x) If you convert the number to a string and reverse it, you will obtain the same outcome.
ivann1987 [930]20 days ago
7 0
No = 3456 You're welcome; I just took a test that included this.
You might be interested in
python Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value i
oksian1 [797]

int currentNumber,previousNumber = -1, countDuplicates = 0;

do {

cin >> currentNumber;

if ( previousNumber == -1) {

previousNumber = currentNumber;

}else {

if ( previousNumber == currentNumber )

countDuplicates++;

else

previousNumber = currentNumber;

}

} while(currentNumber > 0 );

cout << countDuplicates;

7 0
1 month ago
The PictureBook class is a subclass of the Book class that has one additional attribute: a String variable named illustrator tha
Amiraneli [921]

Response:

s

Clarification:

x

8 0
1 month ago
Define a method printAll() for class PetData that prints output as follows with inputs "Fluffy", 5, and 4444. Hint: Make use of
ivann1987 [930]

Answer:

public void printAll(){ // member function petAll()

   super.printAll(); //  invokes printAll() method from the superclass (base class) AnimalData using the super keyword

   System.out.print(", ID: " + idNum);} // displays the ID saved in the idNum field of the PetData class

Explanation:

This is the full PetData class:

public class PetData extends AnimalData { //

private int idNum;

public void setID(int petID) {

idNum = petID; }

// FIXME: Implement printAll() member method

/* Your solution goes here */

public void printAll(){

   super.printAll();

   System.out.print(", ID: " + idNum);}  }

The PetData class is a subclass that inherits from the base class AnimalData.

This class contains a private field, idNum, which is designated for storing the ID value.

It includes a method setID which takes petID as a parameter that corresponds to idNum. Essentially, this acts as a mutator to set the user ID.

Additionally, there is a printAll() method that makes use of the super keyword to call the printAll() method from the base class, AnimalData.

Using super refers to objects of the base class.

Here, the super keyword is utilized with the method name from the subclass PetData to avoid confusion, as both AnimalData and PetData have a method named printAll().

During the main() method, users will enter values for userName, UserAge, and UserID. For example, if the user inputs Fluffy as the name, 5 as the age, and 4444 as the userID. Then, calling userPet.printAll(); will execute the printAll() method from the PetData class since userPet is an instance of PetData.

When this method executes, it will call the printAll() of AnimalData class which outputs the Name and Age, while printAll() of PetData prints the ID. Consequently, the resulting output will be:

Name: Fluffy, Age: 5, ID: 4444

8 0
1 month ago
A regional trucking company landed a contract to supply products for a major retailer. To do this, it needs to hire an IT profes
zubka84 [942]
I believe the answers are F and A
.
8 0
13 days ago
c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
maria [879]

The following code will assist you in solving the specified problem; you can run it and verify against some sample input and output.

#include<stdio.h>

#include<string.h>

 int* uniqueValue(int input1,int input2[])

 {

   int left, current;

   static int arr[4] = {0};

   int i      = 0;

     for(i=0;i<input1;i++)

      {

         current = input2[i];

         left    = 0;

         if(current > 0)

         left    = arr[(current-1)];

      if(left == 0 && arr[current] == 0)

       {

       arr[current] = input1-current;

       }

       else

   {

       for(int j=(i+1);j<input1;j++)

       {

           if(arr[j] == 0)

           {

               left = arr[(j-1)];

               arr[j] = left - 1;

           }

       }

   }

}

return arr;

}

4 0
11 days ago
Other questions:
  • While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The changes
    7·1 answer
  • In Python, what kind of error is returned by the following code? (e.g. NameError, ValueError, IOError, etc.) def my_func(n1, n2)
    8·1 answer
  • What are the differences between a policy, a standard, and a practice? What are the three types of security policies? Where woul
    15·1 answer
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • 5.15 LAB: Output values below an amount Write a program that first gets a list of integers from input. The input begins with an
    9·2 answers
  • Andre is finding working in an online group challenging because there are people in the group from many different cultural backg
    15·2 answers
  • A computer program is tested by 5 independent tests. If there is an error, these tests will discover it with probabilities 0.1,
    5·1 answer
  • explain why entrepreneurial activities are important to social development and progress of the econo​
    9·1 answer
  • Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:teamWins / (teamWin
    15·1 answer
  • Which of the following does not describe local alignment algorithm?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!