Question

Create a variable named my_student_ID and assign YOUR STUDENT ID to it. Write a program that...

Create a variable named my_student_ID and assign YOUR STUDENT ID to it. Write a program that generates a random integer between 1 and 10, inclusive; then displays the generated random integer and digits in my_student_ID that are less then or equal to the generated integer as a list. For example, if your student id is 45755245642 and the computer generates 4, then your program should display the below message

random integer is 4

list of integer that are less than or equal to random integer is [4, 2, 4, 4, 2]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Python Code:

#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main() {
long int student_id=45755245642;
srand(time(0));
int randomNumber = (rand() %(10-1 + 1))+1;
cout<<"Random integer is : "<<randomNumber<<endl;
while

}

Random integer is : list of integer that are less than or equal to random integer is 14, 2, 4 1 4, 2] I 3 4 main.py saved imp

if you like the answer please provide a thumbs up.

Add a comment
Know the answer?
Add Answer to:
Create a variable named my_student_ID and assign YOUR STUDENT ID to it. Write a program that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a c++ program that does the following Create an integer array of size 30. Assign...

    Write a c++ program that does the following Create an integer array of size 30. Assign -1 to each location in the array indicating that the array is empty. Populate half of the array with random integer values between 100 and 500 inclusive. Use the following formula in order to hash and store each number in its proper position/location. Generated Number Table Size: Should a collision occurs, use linear probing to find next available position location. Use the following probing...

  • Graded Exercise Create a class named Student. A Student has fields for an ID number, number...

    Graded Exercise Create a class named Student. A Student has fields for an ID number, number of credit hours earned, and number of points earned. (For example, many schools compute grade point averages based on a scale of 4, so a three-credit-hour class in which a student earns an A is worth 12 points.) Include methods to assign values to all fields. A Student also has a field for grade point average. Include a method to compute the grade point...

  • Write a C++ program that simulates a lottery game. Your program should use functions and arrays....

    Write a C++ program that simulates a lottery game. Your program should use functions and arrays. Define two global constants: - ARRAY_SIZE that stores the number of drawn numbers (for example 5) -MAX_RANGE that stores the highest value of the numbers ( for example 9 ) The program will use an array of five integers named lottery, and should generate a random number in the range of 0 through 9 for each element of the array. The user should enter...

  • Must be done in C# please! Thanks! In this assignment you will create a program named...

    Must be done in C# please! Thanks! In this assignment you will create a program named Test Scores that displays the average of all tests; average midterm score; average final score; and displays the midterm or final score of a particular student. Create a class level two dimensional integer array named Grades initialized with the following data: 897 242 301 987 116 450 865 128 992 109 88 75 94 70 90 87 81 79 97 79 78 80 92...

  • Create a Java Program/Class named ComputeInterest to calculate compound interest. This can all be done entirely...

    Create a Java Program/Class named ComputeInterest to calculate compound interest. This can all be done entirely in the main() method. Create a double variable named currentBalance. Create a double variable named newBalance. Create a final double variable named INTEREST_RATE and assign 1.05 to it. Create a int variable named yearCount. Prompt for the "Number of years to invest" and store the input into the yearCount variable. Prompt for the "Amount to Invest" and store this in the currentBalance variable. Assign...

  • Create a new MATLAB Script file named MT3P3_itname.m. In your script file perform the following calculations:...

    Create a new MATLAB Script file named MT3P3_itname.m. In your script file perform the following calculations: Prompt the user to enter an integer. Use a multiple if-elseif structure to determine the following: Confirm that the number is an integer. If not, the program displays message 1. Check if the number is divisible by 2 and displays message 2. Check if the number is divisible by 3 and displays message 3. For anything other than 1, 2, or 3, the program...

  • SC 111 - BMCC Exam Student Name: Type # 4 - 20 Points write a program...

    SC 111 - BMCC Exam Student Name: Type # 4 - 20 Points write a program that uses a structure named Student to store the following information about a Student: Name ID GPA Address The program should create three Student instances, store values, and pass all of them to a function that displays the information about the Student in a clearly formatted manner. The program also uses another function to calculate and display the average GPA of all three Students.

  • Create a variable $a and assign it a value of 3 then use the write-host command...

    Create a variable $a and assign it a value of 3 then use the write-host command to display the value. Write a command to find the type of variable $a. Create a variable $myname with your firstname and surname in it. Use the pipe symbol and gm to work out what methods are available to make it all uppercase or lowercase. Write a command that displays only the services that are running. Write a command that displays only the services...

  • Program in IDLE: At a university, each student is assigned a system login name, which the...

    Program in IDLE: At a university, each student is assigned a system login name, which the student uses to log into the campus computer system. As part of your internship with the university's Information Technology department, you have been asked to write the code that generates system login names for students. You will use the following algorithm to generate a login name: 1) Get the first 3 characters of the student's first name. 2) Get the first 2 characters of...

  • a. Write a program that reads your id and full name and display. And also display...

    a. Write a program that reads your id and full name and display. And also display the index of first letter and last letter of your full name. b. Modify above program, Declare a string course, let your program read course from user, check if course is not equal to comp2002, clear the string otherwise concatenate course and "Computer Science Department". c. Modify above program declare a string college="". If string college is empty then assign a new string "College...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT