1answer.
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
GarryVolchara [31]
3 years ago
15

Create a program in Python that prompts the user to enter an integer number within the range of 1 to 10 inclusive. The program s

hould display “correct input” if the input is within the given range else it should display “wrong input”.

Computers and Technology
2 answers:
lapo4ka [179]3 years ago
8 0

Answer:

dont know if it works!

Explanation:

input=(input("enter number")

if input > 1

print("correct input")

if input <10

print("correct input")

else

print("wrong input")

Gwar [14]3 years ago
7 0

Python Code with Explanation:

# create a function named func to implement the required logic

def func():

# get the input from the user and store it in a variable named number

   number = int(input("Please enter an integer between 1 to 10 inclusive\n"))

# if the input number is equal or greater than 1 and equal to 10 or less then the input is correct    

   if number>=1 and number<=10:

# print correct input

       return print("Correct input")

# else the input is wrong

   else:

# print wrong input

       return print("Wrong input")

# call the function func

func()

Output:

Test 1:

Please enter an integer between 1 to 10 inclusive

4

Correct input

Test 2:

Please enter an integer between 1 to 10 inclusive

0

Wrong input

Test 3:

Please enter an integer between 1 to 10 inclusive

11

Wrong input

You might be interested in
G The method of mapping where each memory locationis mapped to exactly one location in the cache is
Otrada [13]

Answer:

Direct Mapped Cache

Explanation:

Given that a Direct Mapped Cache is a form of mapping whereby each main memory address is mapped into precisely one cache block.

It is considered cheaper compared to the associative method of cache mapping, and it is faster when searching through it. This is because it utilizes a tag field only.

Hence, The method of mapping where each memory location is mapped to exactly one location in the cache is "Direct Mapped Cache"

4 0
3 years ago
Create your own unique Java application to read all data from the file echoing the data to standard output. After all data has b
mafiozo [28]

Answer:

<u>Output</u>

The values read are:  

25

3

4

65

7

9

5

6

1

11

10 data values were read

Explanation:

Below is the Java program to read all data from the file echoing the data to standard output and finally displaying how many data were read:-

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class MyFileReader {

public static void main(String[] args){

 int num,counter=0;

 File file=new File("numbers.txt");

 try {

  Scanner input=new Scanner(file);

  System.out.println("The values read are: ");

  while(input.hasNext()){

   num=input.nextInt();

   System.out.println(num);

   counter+=1;

  }

  System.out.println(counter+" data values were read");

 } catch (FileNotFoundException e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

 }

}

}

8 0
3 years ago
What is a milestone? Provide a few examples of milestones.
sineoko [7]

Answer:

A milestone is a significant progress point within your project. Milestones' main purpose is to set goals you have to achieve in order to succeed and complete your project

Explanation:

-Example 1-

You have to write a report for your project. This report contains introduction, problem background, results, and recommendations. The milestones for writing your report could be:

Milestone 1: introduction section is completed

Milestone 2: problem background section is completed

Milestone 3: results section is completed

Milestone 4: recommendations section is completed

-Example 2-

You have to design a webpage that allows the user to login, enters his/her name, and logout. The milestones in this case could be:

Milestone 1: login functionality is completed

Milestone 2: text field for typing the name is placed

Milestone 3: submit name button functionality is completed

Milestone 4: logout button functionality is completed

Milestone 5: all components of the webpage are fully integrated

You might think the goals in these examples can be set differently, and that is true. The definition of the milestones is in general subjective and it depends on how you design the steps you want to follow to complete your project. You might also want to add these milestones to a timeline so you have an estimated schedule of the development of your project.

4 0
3 years ago
Write a class named Add that has the following data members, constructor, and methods:
taurus [48]

Answer:

A class is like a blueprint of object.

Explanation:

A class defines the kinds of data and the functionality their objects will have.

A class enables you to create your own custom types by grouping together variables of other types, methods and events.

In C#, we can create a class  using the class keyword.

Here's a sample program:

using System;

namespace ConsoleApplication

{

   public class Test

   {

       public static void Main()

       {

           Add a1 = new Add(70, 50);

           a1.AddNumbers();                    

           Console.ReadLine();

       }      

   }

     class Add

   {

       private int row;

       private int column;

       public Add(int r, int c)

       {

           row = r;

           column = c;

       }

       public void AddNumbers()

       {

           Console.WriteLine(row+column);

       }

   }

}

output: 120

Explanation of the program:

I have created a class named Add. Within a class, row and column are two fields and AddNumbers() is a method. We also have constructor to initialize row and column.

In main method, If I need to invoke members of the class, I must create  an instance of the class. We can create any number of instances using the single class.IN our program, a1 is the reference variable using which we can invoke members of the class. I invoked function in the class and passed arguments to the constructor while creating an instance.

Those values are assigned to method variables and it operated the addition. Thus the output is 120.

7 0
3 years ago
Which of the following is a popular open source intrusion detection system that runs on SmoothWall?? Synchronous Dynamic Random
SCORPION-xisa [38]

Answer: Snort

Explanation:Snort is a system which provides the service of the prevention of the intrusion. This system works as the open source for provision of the logging of packets and traffic analysis.

The functions in the snort are analysis of the protocol, content matching , searching etc. The main purpose of it is for the detection of the attack like stealth port ,CGI attacks etc.Other options are incorrect because they don't provides attack detection service.Thus the correct option is snort.

3 0
3 years ago
Other questions:
  • You are going to send a document to a client, and you want to be absolutely sure that none of the
    8·1 answer
  • What should you keep in mind when installing hard drives?
    5·1 answer
  • Which of the following protocols is used to unsure secure transmissions on port 443?A. HTTPSB. TelnetC. SFTPD. SHTTP
    6·1 answer
  • The network of satellites monitoring continental movement is referred to as
    7·1 answer
  • Security administrator for your organization utilized a heuristic system to detect an anomaly in a desktop computer's baseline.
    7·1 answer
  • c++ Project 6: Buoyancy. Buoyancy is the ability of an object to float. Archimedes’ principle states that the buoyant force is e
    13·1 answer
  • Here is what my rob-lox user USED to look like, btw what is better, Samsung or apple?
    13·2 answers
  • Write a pseudocode for the logic of a program that accepts five numbers from a user and displays one of the following messages:-
    8·1 answer
  • Describe the five components of a computer
    6·1 answer
  • write the few lines of code that prompts the user to enter a series of exam scores, stopping when the user has entered an exam s
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!