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
jok3333 [9.3K]
2 years ago
14

Create a different version of the program that: Takes a 3-digit number and generates a 6-digit number with the 3-digit number re

peated, for example, 391 becomes 391391. The rule is to multiply the 3-digit number by 7*11*13. Takes a 5-digit number and generates a 10-digit number with the 5-digit number repeated, for example, 49522 becomes 4952249522. The rule is to multiply the 5-digit number by 11*9091.
Computers and Technology
1 answer:
alukav5142 [94]2 years ago
4 0

Answer:

#1

threedigit = int(input("Enter any three digit: "))

if not(len(str(threedigit)) == 3):

     print("Input must be three digits")

else:

     print(str(threedigit * 7 * 11 * 13))

#2  

fivedigit = int(input("Enter any five digit: "))

if not(len(str(fivedigit)) == 5):

     print("Input must be five digits")

else:

     print(str(fivedigit * 11 * 9091))

Explanation:

First program begins here

#1

This line prompts user for input of three digits

threedigit = int(input("Enter any three digit: "))

The following if condition checks if user input is exactly 3 digits

if not(len(str(threedigit)) == 3):

     print("Input must be three digits")

else:

     print(str(threedigit * 7 * 11 * 13)) -> This line is executed if input is 3 digits

Second program begins here

#2  

This line prompts user for input of five digits

fivedigit = int(input("Enter any five digit: "))

The following if condition checks if user input is exactly 3 digits

if not(len(str(fivedigit)) == 5):

     print("Input must be five digits")

else:

     print(str(fivedigit * 11 * 9091)) -> This line is executed if input is 5 digits

You might be interested in
Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is
Nataly [62]

Answer:

import random

decisions = int(input("How many decisions: "))

for i in range(decisions):

   number = random.randint(0, 1)

   if number == 0:

       print("heads")

   else:

       print("tails")

Explanation:

*The code is in Python.

import the random to be able to generate random numbers

Ask the user to enter the number of decisions

Create a for loop that iterates number of decisions times. For each round; generate a number between 0 and 1 using the randint() method. Check the number. If it is equal to 0, print "heads". Otherwise, print "tails"

7 0
2 years ago
Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of s
alekssr [168]

Answer:

"public static void passAList(ArrayList<Integer> myList, int[] intArr)", is the correct answer for the above question.

Explanation:

Missing information :

  • The option is missing but the question states "choose from the following". The correct defining syntax is defined above.

Detailed Explantion :

  • The above question asked about syntax which takes the value of list and array as an argument.
  • It is already defined in the above syntax.
  • And the value is passed by the user at the time of function call.
  • The array list is defined by the help of the ArrayList class and the array is defined by the help of the "[]" symbol.

3 0
2 years ago
Two middle-order batsmen are compared based on their performance in their previous cricket match.
Zolol [24]
How many points is this for
5 0
2 years ago
3.34 LAB: Mad Lib - loops in C++
Ganezh [65]

Answer:

A Program was written to carry out some set activities. below is the code program in C++ in the explanation section

Explanation:

Solution

CODE

#include <iostream>

using namespace std;

int main() {

string name; // variables

int number;

cin >> name >> number; // taking user input

while(number != 0)

{

// printing output

cout << "Eating " << number << " " << name << " a day keeps the doctor away." << endl;

// taking user input again

cin >> name >> number;

}

}

Note: Kindly find an attached copy of the compiled program output to this question.

7 0
2 years ago
Allie is choosing a URL for her band’s website, which is the best method of making the URL easy to understand? creating a URL wi
gayaneshka [121]
URL stands for Uniform Resource Locator. It<span> identifies the location of a </span>file<span> on the internet and is used in order the </span><span>web browser to know where to look. </span><span>The entire address www.brainly.com is called the URL.</span><span>
The best method of making the URL easy to understand is creating humam-readable URL.</span>
7 0
2 years ago
Read 2 more answers
Other questions:
  • A computer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a ser
    9·1 answer
  • Edward has started up a new company with his friend, Matthew. Currently, he has only two people working with him. Which type of
    8·1 answer
  • When performing actions between your computer and one that is infected with a virus which of the following offers no risk becomi
    5·1 answer
  • What is the Gain (dB) of a transmission if the Maximum Data Rate is 1 Gbps and the Bandwidth =7000 MHz? Group of answer choices
    6·1 answer
  • Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working. Describe each pos
    14·1 answer
  • Se dau lungimile a N cuvinte (0 &lt; N ≤ 5 000), formate din cel puțin un caracter. Să se afișeze lungimea minimă necesară R a u
    14·1 answer
  • Your project must satisfy the following requirements:
    7·1 answer
  • Five friends plan to try a startup. However, they have a limited budget and limited computer infrastructure. How can they avail
    11·1 answer
  • A script sets up user accounts and installs software for a machine. Which stage of the hardware lifecycle does this scenario bel
    5·1 answer
  • Select the correct navigational path to freeze the top row of your worksheet. Select the panes you wish to freeze. Click the tab
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!