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
zlopas [31]
2 years ago
12

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to

print two random integers between (and including) 0 and 9. End with a newline. Ex:
5.
7.
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)
1 #include
2 #include //
3 Enables use of rand ()
4 int main(void) ( int seedval;
6.
7. scanf ("%d", &seedval);
8.
9.
10 srand(int seedval);
11 printf("%d\n", srand());
12 printf("%d\n", srand());
13
14 return e;
15 }
Computers and Technology
1 answer:
Alik [6]2 years ago
8 0

Answer:

#include<stdio.h>

#include<stdlib.h>

int main(void){

int seedval;

scanf ("%d", &seedval);

srand(seedval);

printf("%d\n", rand()%10);

printf("%d\n", rand()%10);

 return 0;

}

Explanation:

The given code is poorly formatted. So, I picked what is usable from the code to write the following lines of code:

#include<stdio.h>

#include<stdlib.h>

int main(void){

This line declares seedval as integer

int seedval;

This line gets user input for seedval

scanf ("%d", &seedval);

This line calls the srand function to generate random numbers

srand(seedval);

This prints a random number between 0 and 9

printf("%d\n", rand()%10);

This also prints a random number between 0 and 9

printf("%d\n", rand()%10);

 return 0;

}

You might be interested in
What common communication devices are used in homes to connect to the internet and remote networks and what capabilities do thes
harkovskaia [24]

Answer:

A device is indeed a computer unit that can relay a signal throughout the phone, any contact cable or wirelessly. A modem is the best illustration of such a device of communication.

Explanation:

A device that transforms a computer's signals and transmits data over cell towers, known as Modem.

It stands for "Modulator and Demodulator" and are of two types such as: Internal and External. It is being used for accessing the site that modulates carrier tides to encode the transmitting data as well as demodulates arriving waves to decode the documentation they hold.

Other means of communication shall include:

  • Routers.
  • Hub.
  • Switch.
  • Bridge.
  • Network cards.

So, it's the right answer.

6 0
3 years ago
Henry has created a software product that manages a database of company clients. He wants to install the software on a client's
UkoKoshka [18]

Answer:

The answer is " Run the software on the original web browser practically".

Explanation:

The Virtual servers enable you to run programming not programmed to the devices. Let's all presume which Henry's software will operate on computers but not on the mac. Since Mac is unable to run this software, it can practically install Linux on MC and install this.

  • The several common software applications such as parallels, VMware, and Virtual machines could be practically used during mac to install windows.
  • Its platform operating system from a macOS software perspective is a true physical computer with almost everything set.
5 0
2 years ago
Banking Account
satela [25.4K]

Answer:

Here is the Python script solution.

Explanation:

#!/usr/bin/python

"""Types of bank accounts"""

# Assignment:

# Bank Account Manager - Create a class called Account which will be an abstract

# class for three other classes called CheckingAccount, SavingsAccount and

# BusinessAccount. Manage credits and debits from these accounts through an ATM

# style program.

from __future__ import print_function

def pct_to_dec(num):

"""Returns decimal version of percent"""

dec = float(num) / 100

return dec

class Account(object):

"""Creates an Account"""

def __init__(self, balance, int_rate, act_type, min_balance, **kwargs):

self.balance = balance

self.int_rate = int_rate

self.act_type = act_type

self.min_balance = min_balance

super(Account, self).__init__(**kwargs)

def __str__(self):

"""Returns formatted account type and balance"""

# Charge $25 fee if balance drops below minimum

if self.balance < self.min_balance:

self.balance -= 25

# Add interest

self.balance += round(self.balance * pct_to_dec(self.int_rate), 2)

return '{0}: ${1}'.format(self.act_type, self.balance)

class CheckingAccount(Account):

"""Creates a CheckingAccount Account"""

def __init__(self, **kwargs):

super(CheckingAccount, self).__init__(**kwargs)

class SavingsAccount(Account):

"""Creates a SavingsAccount Account"""

def __init__(self, **kwargs):

super(SavingsAccount, self).__init__(**kwargs)

class BusinessAccount(Account):

"""Creates a BusinessAccount Account"""

def __init__(self, **kwargs):

super(BusinessAccount, self).__init__(**kwargs)

# pylint: disable=C0103

ca1 = CheckingAccount(balance=500, int_rate=0.25, act_type='Checking Account',

min_balance=0)

sa1 = SavingsAccount(balance=50, int_rate=0.50, act_type='Savings Account',

min_balance=0)

ba1 = BusinessAccount(balance=4000, int_rate=0.75, act_type='Business Account',

min_balance=5000)

# Month #1 statement, initial deposits plus interest

print(ca1)

print(sa1)

print(ba1)

print('-------------')

# Month #2 statement plus interest

# Make deposit into checking

setattr(ca1, 'balance', (ca1.balance + 1000))

# Withdraw from checking

setattr(ca1, 'balance', (ca1.balance - 500))

# Make a deposit into savings

setattr(sa1, 'balance', (sa1.balance + 100))

print(ca1)

print(sa1)

print(ba1)

print('-------------')

# Month #3 statement plus interest

# Make deposit into checking

setattr(ca1, 'balance', (ca1.balance + 2500))

# Withdraw from checking

setattr(ca1, 'balance', (ca1.balance - 700))

# Make a deposit into savings

setattr(sa1, 'balance', (sa1.balance + 100))

# Make a deposit into business

setattr(ba1, 'balance', (ba1.balance + 1000))

print(ca1)

print(sa1)

print(ba1)

4 0
3 years ago
A project manager sets up a recurring invite for meetings using a web-based calendar app on a mobile device. What type of automa
eduard

A project manager uses a mobile device's web-based calendar tool to set up recurrent meeting invitations. The type of automation this exemplifies is Intelligent automation.

<h3>What is intelligent automation?</h3>

Intelligent automation is also called alternately intelligent process automation. This is a type of software that includes artificial intelligence and robotics.

The combined software provides end-to-end business automation and quickens digital transformation. There are three types of IA. Narrow, super, and general IA.

Thus, the type of automation this exemplifies is Intelligent automation.

To learn more about intelligent automation, refer to the below link:

brainly.com/question/28222698

#SPJ4

6 0
1 year ago
A citizen of any group both
erastovalidia [21]

Answer:

Rights and Responsibilities

Explanation:

4 0
2 years ago
Other questions:
  • True / False<br> Registers are generally optimized for capacity instead of speed.
    14·1 answer
  • What information is required for a complete citation of a website source?
    8·2 answers
  • 80% OF QUESTIONS ARE ANSWERED IN UNDER 10 MINUTES why not mine
    15·2 answers
  • There are two types of short-term memory: one type is involved in the input and storage of new information, the other type of sh
    9·1 answer
  • Write a grammar for the language consisting of strings built only of the letters a and b. The strings may have any number of the
    6·1 answer
  • Alison retrieved data from a company database containing personal information on customers. When she looks at the SSN field, she
    14·1 answer
  • How does the teacher know you have completed your assignment in Google Classroom?
    12·1 answer
  • You press the F9 key to convert an object to a symbol true or false​
    12·1 answer
  • Which statement correctly differentiates how to use list and table styles?
    12·2 answers
  • I am making a project i have to advertise a product i picked a futureistic car
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!