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
balandron [24]
3 years ago
5

Create a Divisible application that displays a random integer between 1 and 100 and displays appropriate messages stating whethe

r the integer is even or odd, if the integer is divisible by 2, and if the integer is divisible by 3 when the Generate Number button is clicked. The application interface should look similar to:
Computers and Technology
1 answer:
mrs_skeptik [129]3 years ago
3 0

Answer:

function myFunction() {

 myNumber = Math.floor(Math.random() * 100) + 1 ;

 var values = ["Number is even", "Number is odd"] ;

 var stringNum = " ";

 if (myNumber % 2 === 0){

     stringNum += values[0];

 } else {

     stringNum += values[1];

 document.getElementById("demo").innerHTML = stringNum;

}

Explanation:

The javascript source code is used by the browser to make the web application interactive, making a clickable event for the button to generate an H1 header for the web page.

The myFunction is assigned to an onclick event of a html button tag to display if a random number between 1 and 100 is even or odd.

You might be interested in
A. A set of electronic program that makes of computer perform tasks
Nonamiya [84]

Answer:

2. Software

Explanation:

Software is an app

Hardware is the computer or cell phone or mobile phone

toppr

6 0
2 years ago
"Write a program that calculates the balance of a savings account at the end of a period of time. It should ask the user for the
Akimi4 [234]

Answer:

#include <iostream>

#include <fstream>

using namespace std;

int main() {

// Definitions

       double annualInterest;          // The annual interest rate

       double balance;                 // The account balance

       int months;                     // Total number of months

       double totalDeposit  = 0.0;     // Total deposited value

       double totalWithdraw = 0.0;     // Total withdrawn value

       double earnedInterest= 0.0;     // The earned amount

       double deposited;               // Monthly deposited value

       double withdrawn;               // Monthly withdrawn value

// Get the initial required data.

       

       cout<<"Please enter the annual interest rate,\n";

       cout<<"   Interest rate: ";

       cin >>annualInterest;

       cout<<"--------------------------------------------\n";

       cout<<"Please enter the starting balance,\n";

       do{

           cout<<"[the number could not be negative]\n";

           cout<<"Starting Balance: ";

           cin >>balance;

       }while(balance<0);

       cout<<"--------------------------------------------\n";

       cout<<"Please enter the number of months,\n";

       do{

           cout<<"[the number could not be less than 0]\n";

           cout<<"Number of months: ";

           cin >>months;

       }while(months<0);

// Iterated Loop to get all the months data.

       for(int month=1; month <= months; month++){

// Get the deposited value during that month.

           cout<<"Enter the deposited value during month "

               <<month<<",\n";

           do{

               cout<<"[the value could not be less than 0]\n";

               cout<<" Deposited value: ";

               cin >>deposited;

           }while(deposited<0);

           

           totalDeposit += deposited;

           balance += deposited;

// Get the withdrawn value during that month.

           cout<<"Enter the withdrawn value during month "

               <<month<<",\n";

           do{

               cout<<"[the value could not be less than 0]\n";

               cout<<" Withdrawn value: ";

               cin >>withdrawn;

           }while(withdrawn<0);

           

           totalWithdraw += withdrawn;

           balance -= withdrawn;

// Negative balance close the program.

           if(balance < 0){

               cout<<"Sorry, the account has been closed due to\n";

               cout<<"the negative balance.\n";

                 break;

// Calculate value due to the interest rate.

           }

      else {

               earnedInterest += (annualInterest/12) * balance;

               //        monthly interest rate

               balance += (annualInterest/12) * balance;

           }

       }

  // Display the statistics,

      ofstream file;

      file.open ("Report written to Report.txt");

      file << "Report written to Report.txt\n";

       file.close();

       cout<<"The ending balance: "<<balance<<std::endl;

       cout<<"   Total deposited: "<< totalDeposit<<std::endl;

       cout<<" Total withdrawals: "<< totalWithdraw<<std::endl;

       cout<<"   Earned interest: "<< earnedInterest<<std::endl;

       cout<<"============================================\n";

 return 0;

   }

   

6 0
3 years ago
Clusters always occur in multiples of what? <br> A.)10 <br> B.)5<br> C.)2 <br> D.)100
kotykmax [81]
I would say ten would be the answer
8 0
3 years ago
Read 2 more answers
Emily loves her job as an executive recruiter for a large hospital located in Seattle, Washington. Part of Emily's job requires
Nana76 [90]

Answer:

D. Collective intelligence

Explanation:

Collective intelligence appears when people work together. It is derived  from the collaboration, collective actions, and competition of many parties.

In Emily's job, she collaborate with partners, compare competitors and tap into the knowledge of prospective employees, partners, and customers. Thus, she performs collective intelligence.

3 0
3 years ago
All of the following are examples of extracurricular activities except:
mart [117]
A, because normally that would be a requirment
8 0
3 years ago
Read 2 more answers
Other questions:
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
    9·1 answer
  • Do most facebook and twitter users access the platform from their personal computers?
    6·2 answers
  • Which of the following correctly describes the function of an IP address?
    7·1 answer
  • Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
    12·1 answer
  • Write a program that asks the user to enter a whole number then outputs a 0 if the number is even or a 1 if the number is odd. (
    14·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
  • Write a program that tells what coins to give out for any amount of change from 1
    6·1 answer
  • It is unlawful in the State of Florida for any person, ______________________, to be a passenger in the front seat of a motor ve
    7·1 answer
  • Which of the following describe audio-editing software? Choose all that apply.
    5·2 answers
  • Bluetooth is the popular name for the 802. 15 wireless networking standard, which is useful for creating small __________.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!