LAB: Count multiples (EO)
Complete a program that creates an object of the Count class, takes three integers as input: low, high, and x, and then calls the countMultiples() method. The countMultiples() method then returns the number of multiples of x between low and high inclusively.
Ex: If the input is:
1 10 2
countMutiples() returns and the program output is:
5
Hint: Use the % operator to determine if a number is a multiple of x. Use a for loop to test each number between low and high.
Note: Your program must define the method:
public int countMultiples(int low, int high, int x)
Count.java
1 import java.util.Scanner;
2
3 public class Count {
4
5 public int countMultiples(int low, int high, int x) {
6 /* Type your code here. */
7
8 }
9
10 public static void main(String[] args) {
11 Scanner scnr = new Scanner(System.in);
12 /* Type your code here. */
13 }
14)
15

Answers

Answer 1

Following are the Java Program to the given question:

import java.util.Scanner; //import package for user-input

public class Count  //defining a class Count  

{

   public static int countMultiples(int low,int high,int x)//defining a method countMultiples that takes three integer parameters

   {  

       int c=0,i; //defining integer variables that hold value

       for(i=low;i<=high;i++)//defining loop that iterates value between low and high  

       {  

           if(i%x==0)//defining if block that uses % operator to check value

           {

               c+=1; //incrementing c value

           }

       }

       return c; //return c value

   }

   public static void main(String[] args)//main method  

   {  

       int l,h,x;//defining integer variable

       Scanner scnr=new Scanner(System.in); //creating scanner class object  

       l=scnr.nextInt(); //input value

       h=scnr.nextInt();//input value

       x=scnr.nextInt();//input value

       System.out.println(countMultiples(l,h,x)); //calling method and print its value

   }

}

Output:

Please find the attached file.

Program Explanation:

Import package.Defining a class "Count", and inside the class two method "countMultiples and main method" is declared.In the "countMultiples" method three integer parameter that are "low, high, and x".Inside this method a for loop is declared that uses the parameter value and use conditional statement with the % operator and check and return its values.Inside the main method three integer variable is declared that uses the scanner class to input the value and pass to the method and print its calculated value.  

Learn more:

brainly.com/question/16106262


Related Questions

If you fail a course as a MAIN (residency) course, you can repeat that course as either a MAIN (residency) or an online (IG or IIG) course.
A. True
B. False

Answers

it depends on where you are taking your courses. In most cases the answer would be true

Write a program in c++ that will:1. Call a function to input temperatures for consecutive days in 1D array. NOTE: The temperatures will be integer numbers. There will be no more than 10 temperatures.The user will input the number of temperatures to be read. There will be no more than 10 temperatures.2. Call a function to sort the array by ascending order. You can use any sorting algorithm you wish as long as you can explain it.3. Call a function that will return the average of the temperatures. The average should be displayed to two decimal places.Sample Run:Please input the number of temperatures to be read5Input temperature 1:68Input temperature 2:75Input temperature 3:36Input temperature 4:91Input temperature 5:84Sorted temperature array in ascending order is 36 68 75 84 91The average temperature is 70.80The highest temperature is 91.00The lowest temperature is 36.00

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

#include <iomanip>

using namespace std;

int* sortArray(int temp [], int n){

   int tmp;

   for(int i = 0;i < n-1;i++){

 for (int j = i + 1;j < n;j++){

  if (temp[i] > temp[j]){

   tmp  = temp[i];

   temp[i] = temp[j];

   temp[j] = tmp;   }  } }

return temp;

}

float average(int temp [], int n){

   float sum = 0;

   for(int i = 0; i<n;i++){

       sum+=temp[i];    }

   return sum/n;

}

int main(){

   int n;

   cout<<"Number of temperatures: ";    cin>>n;

   while(n>10){

       cout<<"Number of temperatures: ";    cin>>n;    }

   int temp[n];

   for(int i = 0; i<n;i++){

       cout<<"Input temperature "<<i+1<<": ";

       cin>>temp[i];    }

   int *sorted = sortArray(temp, n);

   cout<<"The sorted temperature in ascending order: ";

   for( int i = 0; i < n; i++ ) {  cout << *(sorted + i) << " ";   }

   cout<<endl;

   float ave = average(temp,n);

   cout<<"Average Temperature: "<<setprecision(2)<<ave<<endl;

   cout<<"Highest Temperature: "<<*(sorted + n - 1)<<endl;

   cout<<"Lowest Temperature: "<<*(sorted + 0)<<endl;

   return 0;

}

Explanation:

See attachment for complete source file with explanation

let's have a class named Distance having two private data members such as feet(integer), inches(float), one input function to input values to the data members, one Display function to show the distance. The distance 5 feet and 6.4 inches should be displayed as 5’- 6.4”. Then add the two objects of Distance class and then display the result (the + operator should be overloaded). You should also take care of inches if it's more than 12 then the inches should be decremented by 12 and feet to be incremented by 1.

Answers

Answer:

Humildade

Ser justo (Fair Play)

Vencer independente

Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a comma, including the last one.Ex: If the input is:5 2 4 6 8 10the output is:10,8,6,4,2,To achieve the above, first read the integers into a vector. Then output the vector in reverse.

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

#include <vector>

using namespace std;

int main(){

   vector<int> intVect;

   int n;

   cin>>n;

int intInp;

for (int i = 0; i < n; i++) {

 cin >> intInp;

 intVect.push_back(intInp); }

for (int i = n-1; i >=0; i--) {  cout << intVect[i] << " "; }

 return 0;

}

Explanation:

This declares the vector

   vector<int> intVect;

This declares n as integer; which represents the number of inputs

   int n;

This gets input for n

   cin>>n;

This declares intInp as integer; it is used to get input to the vector

int intInp;

This iterates from 0 to n-1

for (int i = 0; i < n; i++) {

This gets each input

 cin >> intInp;

This passes the input to the vector

 intVect.push_back(intInp); }

This iterates from n - 1 to 0; i.e. in reverse and printe the vector elements in reverse

for (int i = n-1; i >=0; i--) {  cout << intVect[i] << " "; }

Answer to this problem

Answers

Answer:

hi..,.................................................

A student registers for a course in a university. Courses may have limited enrollment i.e a student must
enroll atmost 9 credit hours, the registration process must include checks that places are available. Assume
that the student accesses an electronic course catalog to find out about available courses. Which design
model should be followed by this secenario? Draw any two UML diagrams.

Answers

Answer:

Follows are the complete question to the given question:

Explanation:

The UML scheme is a UML-based diagram intended to depict the system visually, together with its key actors, roles, activities, objects, and classes, to gather information the about system, change that, or maintain it.

Every complex process is better understood via sketches or pictures. These diagrams have a higher understanding effect. By glancing about, we notice that diagrams are not a new idea but are widely used in various business types. To enhance understanding of the system, we prepare UML diagrams. There is not enough of a single diagram to represent all aspects of the system. You can also create customized diagrams to satisfy your needs. Iterative and incremental diagrams are usually done.

There are two broad diagram categories and that they are broken into subclasses again:

Diagram structureDiagrams of behavior

Please find the graph file of the question in the attachment.

In confirmatory visualization Group of answer choices Users expect to see a certain pattern in the data Users confirm the quality of data visualization Users don't know what they are looking for Users typically look for anomaly in the data

Answers

Answer: Users expect to see a certain pattern in the data

Explanation:

Confirmatory Data Analysis occurs when the evidence is being evaluated through the use of traditional statistical tools like confidence, significance, and inference.

In this case, there's an hypothesis and the aim is to determine if the hypothesis is true. In this case, we want to know if a particular pattern on the data visualization conforms to what we have.

If you fail a course as a MAIN (residency) course, you can repeat that course as either a MAIN (residency) or an online (IG or IIG) course. True False

Answers

Answer: False

Explanation:

The statement that "you fail a course as a MAIN (residency) course, you can repeat that course as either a MAIN (residency) or an online (IG or IIG) course" is false.

It should be noted that if one fail a course as a residency course, the course can only be repeated as a main (residency) course and not an online course. When a course is failed, such course has to be repeated the following semester and this will give the person the chance to improve their GPA.

the id selector uses the id attribute of an html element to select a specific element give Example ?​

Answers

Answer:

The id selector selects a particular html element

Explanation:

The id selector is uses the id attribute to select a specific html element. For example, if we have a particular header which is an html element and we want to give it a particular background color, we use the id selector and give it an id attribute in the CSS file. An example of an html header with id = 'blue' is shown below. The style sheet is an internal style sheet.

!doctype html

<html>

<head>

<title>Test</title>

<style>

#blue { background-color: blue;

}

</style>

</head>

<body>

<h1 id = 'blue'>Our holiday</h1>

<p>This is the weekend</p>

</body>

</html>

An e-mail program allows?
A. users to access and view web pages on the internet.
B. geographically separated people to transfer audio and video.
C. real-time exchange of messages or files with another online user.
D. transmission of messages and files via a network such as the internet.​

Answers

Answer:

C

Explanation:

Real time exchange of messages or files with another online user

Which tools do you use for LinkedIn automation?

Answers

Explanation:

Automation tools allow applications, businesses, teams or organizations to automate their processes which could be deployment, execution, testing, validation and so on. Automation tools help increase the speed at which processes are being handled with the main aim of reducing human intervention.

Linkedln automation tools are designed to help automate certain processes in Linkedln such as sending broadcast messages, connection requests, page following and other processes with less or no human or manual efforts. Some of these automation tools include;

i. Sales navigator for finding right prospects thereby helping to build and establish trusting relationships with these prospects.

ii. Crystal for providing insights and information about a specified Linkedln profile.

iii. Dripify used by managers for quick onboarding of new team members, assignment of roles and rights and even management of subscription plans.  

Answer:

Well, for me I personally use LinkedCamap to drive more LinkedIn connections, hundreds of leads, sales, and conversions automatically.  

Some other LinkedIn automation tools are;  

   Expandi      Meet Alfred      Phantombuster      WeConnect      LinkedIn Helper  

Hope this helps!

hub stake should always be provided with a lath stake so that the information about what the hub represents can be written on the lath stake True False

Answers

Answer:

True

Explanation:

To protect them from becoming disturbed by construction operations, hub stakes are placed on both sides of a roadway at a certain distance outside the work zone. The final stakes are connected to the hub stakes, which are used to write the essential information.

As a result, hub stakes are always accompanied with stakes.

LAB: Count characters - methods
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string.
Ex: If the input is
n Monday
the output is
1
Ex: If the input is
Today is Monday
the output is
0
Ex: If the input is
n it's a sunny day
the output is
0
Your program must define and call the following method that returns the number of times the input character appears in the input string public static int countCharacters (char userChar, String userString)
Note: This is a lab from a previous chapter that now requires the use of a method
LabProgram.java
1 import java.util.Scanner
2
3 public class LabProgram
4
5 /* Define your method here */
6
7 public static void main(String[] args) {
8 Type your code here: * >
9 }
10 }

Answers

Answer:

i hope understand you

mark me brainlist

Explanation:

using namespace std;

#include <iostream>

 

#include <string.h>

#include <stdlib.h>

#include <stdio.h>

 

#define BLANK_CHAR (' ')

 

 

int CountCharacters(char userChar, char * userString)

{

 

int countReturn=0;

 

int n = strlen(userString);

 

for (int iLoop=0; iLoop<n; iLoop++)

{

       if (userString[iLoop]==userChar)

       {

        countReturn++;

 }

}

return(countReturn);

}

 

/******************************************

    Removes white spaces from passed string; returns pointer

     to the string that is stripped of the whitespace chars;

   

  Returns NULL pointer is empty string is passed;  

     Side Effects:

 CALLER MUST FREE THE OUTPUT BUFFER that is returned

 

 **********************************************************/

char * RemoveSpaces(char * userString)

{

 

 char * outbuff = NULL;

 

 if (userString!=NULL)

 {

   int n = strlen(userString);

    outbuff = (char *) malloc(n);

 

   if (outbuff != NULL)

   {

          memset(outbuff,0,n);

          int iIndex=0;

          //copies non-blank chars to outbuff

         for (int iLoop=0; iLoop<n; iLoop++)

         {

           if (userString[iLoop]!=BLANK_CHAR)

          {

           outbuff[iIndex]=userString[iLoop];

           iIndex++;

   }

   

   } //for

         

   }

   

   }

 return(outbuff);

 

}

 

 

int main()

{

 

 char inbuff[255];

 cout << " PLEASE INPUT THE STRING OF WHICH YOU WOULD LIKE TO STRIP WHITESPACE CHARS :>";

 gets(inbuff);

 

 char * outbuff = RemoveSpaces(inbuff);

 if (outbuff !=NULL)

 {

    cout << ">" << outbuff << "<" << endl;

    free(outbuff);

    }

     

   memset(inbuff,0,255);  

   cout << " PLEASE INPUT THE STRING IN WHICH YOU WOULD LIKE TO SEARCH CHAR :>";

gets(inbuff);

 

  char chChar;

 cout << "PLEASE INPUT THE CHARCTER YOU SEEK :>";

 cin >> chChar;

 

 int iCount = CountCharacters(chChar,inbuff);

 cout << " char " << chChar << " appears " << iCount << " time(s) in >" << inbuff << "<" << endl;

 

}

Describe the operation of IPv6 Neighbor Discovery. ​

Answers

can you give me the link to an article about this so i may help?

The__________is an HTML tag that provides information on the keywords that represent the contents of a Web page.

Answers

Answer:

Meta tag

Explanation:

write short note on the following: Digital computer, Analog Computer and hybrid computer​

Answers

Answer:

Hybrid Computer has features of both analogue and digital computer. It is fast like analogue computer and has memory and accuracy like digital computers. It can process both continuous and discrete data. So it is widely used in specialized applications where both analogue and digital data is processed.

What order? (function templates) Define a generic function called CheckOrder() that checks if four items are in ascending, neither, or descending order. The function should return -1 if the items are in ascending order, 0 if the items are unordered, and 1 if the items are in descending order. The program reads four items from input and outputs if the items are ordered. The items can be different types, including integers, strings, characters, or doubles. Ex. If the input is:

Answers

Answer:

Explanation:

The following code was written in Java and creates the generic class to allow you to compare any type of data structure. Three different test cases were used using both integers and strings. The first is an ascending list of integers, the second is a descending list of integers, and the third is an unordered list of strings. The output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Order: " + checkOrder(10, 22, 51, 53));

       System.out.println("Order: " + checkOrder(55, 44, 33, 22));

       System.out.println("Order: " + checkOrder("John", " Gabriel", "Daniela", "Zendaya"));

   }

   public static <E extends Comparable<E>> int checkOrder(E var1, E var2, E var3, E var4) {

       E prevVar = var1;

       if (var2.compareTo(prevVar) > 0) {

           prevVar = var2;

       } else {

           if (var3.compareTo(prevVar) < 0) {

               prevVar = var3;

           } else {

               return 0;

           }

           if (var4.compareTo(prevVar) < 0) {

               return 1;

           }  else {

               return 0;

           }

       }

       if (var3.compareTo(prevVar) > 0) {

           prevVar = var3;

       }

       if (var4.compareTo(prevVar) > 0) {

           return -1;

       }

       return 0;

   }

}

The conversion rate would be the highest for keyword searches classified as Group of answer choices buyers grazers researchers browsers

Answers

Answer:

buyers

Explanation:

Search engine optimization (SEO) can be defined as a strategic process which typically involves improving and maximizing the quantity and quality of the number of visitors (website traffics) to a particular website by making it appear topmost among the list of results from a search engine such as Goo-gle, Bing, Yah-oo etc.

This ultimately implies that, search engine optimization (SEO) helps individuals and business firms to maximize the amount of traffic generated by their website i.e strategically placing their website at the top of the results returned by a search engine through the use of algorithms, keywords and phrases, hierarchy, website updates etc.

Hence, search engine optimization (SEO) is focused on improving the ranking in user searches by simply increasing the probability (chances) of a specific website emerging at the top of a web search.

Typically, this is achieved through the proper use of descriptive page titles and heading tags with appropriate keywords.

Generally, the conversion rate is mainly designed to be the highest for keyword searches classified as buyers because they're the main source of revenue for a business and by extension profits.

Write a program that removes all non-alpha characters from the given input. Ex: If the input is: -Hello, 1 world$! the output is: Helloworld

Also, this needs to be answered by 11:59 tonight.

Answers

Answer:

Explanation:

The following code is written in Python. It is a function that takes in a string as a parameter, loops through the string and checks if each character is an alpha char. If it is, then it adds it to an output variable and when it is done looping it prints the output variable. A test case has been provided and the output can be seen in the attached image below.

def checkLetters(str):

   output = ''

   for char in str:

       if char.isalpha() == True:

           output += char

   return output

fill in the blanks Pasaline could ----- and ------- very easily.​

Answers

Answer:

Hot you too friend's house and be safe and have a great time to take care of the following is not a characteristic it was a circle whose equation o

Can you suggest a LinkedIn Helper (automation tool) alternative?

Answers

Answer:

Have you tried LinkedCamp alternative to LinkedIn Helper?

Well, LinkedCamp is a super-efficient cloud-based LinkedIn Automation Tool that empowers businesses and sales industries to drive more LinkedIn connections, hundreds of leads, sales, and conversions automatically.

Some other LinkedIn automation tools are:

Meet Alfred Phantombuster WeConnect ZoptoExpandi

Hope you find it useful.

Good luck!

Being the Sales Manager of a company you have to hire more salesperson for the company to expand the sales territory. Kindly suggest an effective Recruitment and Selection Process to HR by explaining the all the stages in detail.

Answers

Answer:

In order to sales company to expand the sales territory in heeds to target those candidates that have long exposure in sales profile.

Explanation:

Going for a sales interview for the profile of a sales manager in a company. The HR department may require you to answer some questions. Such as what do you like most about sales, how to you motivate your team and how much experience do you have. What are philosophies for making sales Thus first round is of initial screening, reference checking, in-depth interview, employ testing, follow up, and making the selection. This helps to eliminate the undesired candidates.

Web-Based Game that serves multiple platforms
Recommendations
Analyze the characteristics of and techniques specific to various systems architectures and make a recommendation to The Gaming Room. Specifically, address the following:
1. Operating Platform: Recommend an appropriate operating platform that will allow The Gaming Room to expand Draw It or Lose It to other computing environments.>
2. Operating Systems Architectures:
3. Storage Management:
4. Memory Management:
5. Distributed Systems and Networks:
6. Security: Security is a must-have for the client. Explain how to protect user information on and between various platforms. Consider the user protection and security capabilities of the recommended operating platform.>

Answers

Answer:

Here the answer is given as follows,

Explanation:

Operating Platform:-  

In terms of platforms, there are differences between, mobile games and pc games within the way it's used, the operator, the most event play, the sport design, and even the way the sport work. we all know that each one the games on console platforms, PC and mobile, have their own characteristic which has advantages and disadvantages All platforms compete to win the rating for the sake of their platform continuity.  

Operating system architectures:-  

Arm: not powerful compared to x86 has many limitations maximum possibility on arm arch is mobile gaming.  

X86: very powerful, huge development so easy to develop games on platforms like unity and unreal, huge hardware compatibility and support  

Storage management:-  

On the storage side, we've few choices where HDD is slow and too old even a replacement console using SSD. so SSD is the suggested choice. But wait SSD have also many options like SATA and nvme.    

Memory management:-  

As recommended windows, Each process on 32-bit Microsoft Windows has its own virtual address space that permits addressing up to 4 gigabytes of memory. Each process on 64-bit Windows features a virtual address space of 8 terabytes. All threads of a process can access its virtual address space. However, threads cannot access memory that belongs to a different process.  

Distributed systems and networks:-  

Network-based multi-user interaction systems like network games typically include a database shared among the players that are physically distributed and interact with each other over the network. Currently, network game developers need to implement the shared database and inter-player communications from scratch.  

Security:-  

As security side every game, there's an excellent risk that, within the heat of the instant, data are going to be transmitted that you simply better keep to yourself. There are many threats to your IT.  

Define on the whole data protection matters when developing games software may cause significant competitive advantages. Data controllers are obliged under the GDPR to attenuate data collection and processing, using, as an example , anonymization or pseudonymization of private data where feasible.

What is machine learning

Answers

Answer:

machine learning is the ability for computers to develop new skills and algorithms without specific instructions to do so.

Machine learning is a branch of artificial intelligence (AI) and computer science which focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy.

Write a java program that reads a list of integers and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a comma, including the last one. Assume that the list will always contain fewer than 20 integers.


Ex: If the input is:


5 2 4 6 8 10

the output is:


10,8,6,4,2,

To achieve the above, first read the integers into an array. Then output the array in reverse.

Answers

Answer:

Explanation:

using namespace std;

#include <iostream>

int Go()

{

 

int N;

int A[20];

 

 

cout << " How many integers do you have ??? :>";

cin >> N;

if (N>20) { N=20; }

 

for (int iLoop=0; iLoop<N; iLoop++)

{

 

 cout << "Input integer # " << (iLoop+1) << " :>";  

  cin >> A[iLoop];  

 

}

 

for (int iLoop=N-1; iLoop>=0; iLoop--)

{

 cout << A[iLoop] << " ";

}

cout << endl;

 

 

}

int main()

{

Go();

}

A Java program that reads a list of integers and outputs them in reverse is written as,

import java.util.Scanner;

public class ReverseList {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       

       // Read the number of integers

       int numIntegers = scnr.nextInt();

       

       // Create an array to store the integers

       int[] integers = new int[numIntegers];

       

       // Read the integers into the array

       for (int i = 0; i < numIntegers; i++) {

           integers[i] = scnr.nextInt();

       }

       

       // Output the integers in reverse order

       for (int i = numIntegers - 1; i >= 0; i--) {

           System.out.print(integers[i]);

           

           // Add comma unless it's the last integer

           if (i > 0) {

               System.out.print(",");

           }

       }

       

       System.out.println(); // Add a new line at the end

   }

}

Given that,

Write a Java program that reads a list of integers and outputs those integers in reverse.

Here, The input begins with an integer indicating the number of integers that follow.

For coding simplicity, follow each output integer by a comma, including the last one.

So, A Java program that reads a list of integers and outputs them in reverse:

import java.util.Scanner;

public class ReverseList {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       

       // Read the number of integers

       int numIntegers = scnr.nextInt();

       

       // Create an array to store the integers

       int[] integers = new int[numIntegers];

       

       // Read the integers into the array

       for (int i = 0; i < numIntegers; i++) {

           integers[i] = scnr.nextInt();

       }

       

       // Output the integers in reverse order

       for (int i = numIntegers - 1; i >= 0; i--) {

           System.out.print(integers[i]);

           

           // Add comma unless it's the last integer

           if (i > 0) {

               System.out.print(",");

           }

       }

       

       System.out.println(); // Add a new line at the end

   }

}

Read more about java programming language at:

brainly.com/question/2266606

#SPJ4

Java !!!
A common problem in parsing computer languages and compiler implementations is determining if an input string is balanced. That is, a string can be considered balanced if for every opening element ( (, [, <, etc) there is a corresponding closing element ( ), ], >, etc).
Today, we’re interested in writing a method that will determine if a String is balanced. Write a method, isBalanced(String s) that returns true if every opening element is matched by a closing element of exactly the same type. Extra opening elements, or extra closing elements, result in an unbalanced string. For this problem, we are only interested in three sets of characters -- {, (, and [ (and their closing equivalents, }, ), and ]). Other characters, such as <, can be skipped. Extra characters (letters, numbers, other symbols) should all be skipped. Additionally, the ordering of each closing element must match the ordering of each opening element. This is illustrated by examples below.
The following examples illustrate the expected behaviour:
is Balanced ("{{mustache templates use double curly braces}}") should return true
is Balanced("{{but here we have our template wrong!}") should return false
is Balanced("{ ( ( some text ) ) }") should return true
is Balanced("{ ( ( some text ) } )") should return false (note that the ordering of the last two elements is wrong)
Write an implementation that uses one or more Stacks to solve this problem. As a client of the Stack class, you are not concerned with how it works directly, just that it does work.

Answers

Answer:

Explanation:

import java.util.*;

public class BalancedBrackets {

// function to check if brackets are balanced

static boolean isBalanced(String expr)

{

Stack<Character> stack = new Stack<Character>();

for (int i = 0; i < expr.length(); i++)

{

char x = expr.charAt(i);

if (x == '(' || x == '[' || x == '{')

{

// Push the element in the stack

stack.push(x);

continue;

}

if (stack.isEmpty())

return false;

char check;

switch (x) {

case ')':

check = stack.pop();

if (check == '{' || check == '[')

return false;

break;

case '}':

check = stack.pop();

if (check == '(' || check == '[')

return false;

break;

case ']':

check = stack.pop();

if (check == '(' || check == '{')

return false;

break;

}

}

// Check Empty Stack

return (stack.isEmpty());

}

public static void main(String[] args)

{

Scanner scan = new Scanner(System.in);

System.out.println("\nEnter the expression to check is balanced or not !");

String expr = scan.nextLine();

boolean output;

output = isBalanced(expr);

System.out.println(output);

if (output)

System.out.println("Balanced ");

else

System.out.println("Not Balanced ");

scan.close();

}

}

Compute change
A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. For example, 19 yields 3 fives and 4 ones. Write a single statement that assigns the number of one dollar bills to variable numOnes, given amountToChange. Hint: Use the % operator.
import java.util.Scanner;
public class ComputingChange {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int amountToChange;
int numFives;
int numOnes;
amountToChange = scnr.nextInt();
numFives = amountToChange / 5;
/* Your solution goes here */
System.out.print("numFives: ");
System.out.println(numFives);
System.out.print("numOnes: ");
System.out.println(numOnes);
}
}

Answers

Answer:

Explanation:

The following code is written in Java and modified to do as requested. It asks the user to enter a number that is saved to the amountToChange and then uses the % operator to calculate the number of 5 dollar bills and the number of 1 dollar bills to give back. A test case has been provided and the output can be seen in the attached image below.

import java.util.Scanner;

class ComputingChange {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       int amountToChange;

       int numFives;

       int numOnes;

       amountToChange = scnr.nextInt();

       numFives = amountToChange / 5;

       /* Your solution goes here */

       numOnes = amountToChange % 5;

       System.out.print("numFives: ");

       System.out.println(numFives);

       System.out.print("numOnes: ");

       System.out.println(numOnes);

   }

}

Why input screens are better data entry than entreing data dirrctly to a table

Answers

Answer:

are better data entry designs than entering data directly to a table. ... hence a user can design input fields linked to several tables/queries.

Explanation:

Input screens are better data entry designs than entering data directly to a table because a user can design input fields linked to several tables/queries.

What is digital information?

Digital information generally consists of data that is created or prepared for electronic systems and devices such as computers, screens, calculators, communication devices. These information are stored by cloud.

They are converted from digital to analog and vice versa with the help of a device.

Data entered in the table directly is easier than data entry method.

Thus, input screens are better data entry than entering data directly to a table.

Learn more about digital information.

https://brainly.com/question/4507942

#SPJ2

View "The database tutorial for beginners" and discuss how database management systems are different from spreadsheets. Describe one experience you have had working with data.

Answers

Answer and Explanation:

A spreadsheet is an interactive computer application for the analysis and storage of data. The database is a collection of data and accessed from the computer system. This is the main difference between spreadsheets and databases. The spreadsheet is accessed by the user and the database is accessed by the user. The database can store more data than a spreadsheet. The spreadsheet is used for tasks and used in enterprises to store the data. Spreadsheet and database are two methods and the main difference is the computer application that helps to arrange, manage and calculate the data. The database is a collection of data and organized to access easily. Spreadsheet applications were the first spreadsheet on the mainframe. Database stores and manipulates the data easily. The database maintains the data and stores the records of teachers and courses. The spreadsheet is the computer application and analyzing the data in table form. The spreadsheet is a standard feature for productive suite and based on an accounting worksheet.

2. Which tab is used to edit objects on the Slide Master and layouts?
A. View
B. Insert
C. Shape format
D. Design

Answer is not A. View
It’s B. Insert

Answers

Answer:

it is....insert tab..B

Explanation:

insert tab includes editing options

Other Questions
Quadrilateral ABCD is reflected across the x-axis and then reflect across the y-axis to form quadrilateral ABCD. If the coordinates of vertex A are (-7, 3), what are the coordinates of vertex A? Write a recursive function that calculates the sum 11 22 33 ... nn, given an integer value of nin between 1 and 9. You can write a separate power function in this process and call that power function as needed: A phage is improperly assembled, so that it does not receive DNA within its head. What effect will this have on the phage (-3).(+9)-(-24)-(+6).(+2) what type of properties change ina physical change? Give an example to support your answer? pls quick who will give the answer first will get the brainliest An excellent website design delights its audience and is the product of innovation built on a foundation of ~~~~NEED HELP ASAP~~~~Block A slides into block B along a frictionless surface. They are moving in the direction from left o the right. Block A= 3kg Block B= 4kg Block A velocity before collision =30m/s. Block B velocity before collision = 15 m/s The velocity of block B after the collision is 20m/s.a.) What is the velocity of block A after collision?b.) Is the collision elastic? Show work to explain answer why or why not. It is impossible for sperm to be functional (able to fertilize the egg) until after ________. Group of answer choices help please what is the median Importance of English language Which of the following authors wrote an autobiographical slave narrative?I. Frederick DouglassII. Nathaniel HawthorneIII. Harriet Beecher StoweIV. Harriet Ann Jacobs Which statement best explains why water is unevenly distributed in the Middle East?Mountains prevent rain from reaching inland areas.Countries divert water to the most populated areas.Rivers and lakes are scattered throughout the region.O Countries with rivers and freshwater lakes hoard water.What the answer If a property will produce net cash flow that grows at a rate of 1.5% per year in perpetuity, and the opportunity cost of capital is 12%, then what is the "cap rate" (net cash flow / property value) for the property? (a) 8%. (b) 10%. (c) 10.5%. (d) 12%. For 12-15, find the missing measures I need help solving this problem . Which of the following statements is not true? A. Keeping your own doctor appointments will help you to detect certain diseases early but has no impact on preventing the spread of diseases to others.B. You should frequently wash your hands with soap and water to prevent communicable diseases from spreading.C. Cleaning and disinfecting surfaces often is one way that you can help to prevent contracting and spreading communicable diseases.D. To prevent communicable diseases from spreading, you should wash your hands after touching animals and make sure pets receive routine veterinary care. If 'a' is a number lying between 0 and 1. then which of the following is in increasing order? a) a, a, a b) a a ,a c) a,a,a d) a, a, a For purposes of computing the weighted average number of shares outstanding during the year, a transaction that must be treated as if it occurred at the beginning of the year is: 1. You measure 24 textbooks' weights, and find they have a mean weight of 75 ounces. Assume the population standard deviation is 3.3 ounces. Based on this, construct a 90% confidence interval for the true population mean textbook weight.2. You measure 37 backpacks' weights, and find they have a mean weight of 45 ounces. Assume the population standard deviation is 10.1 ounces. Based on this, construct a 95% confidence interval for the true population mean backpack weight.3. You measure 30 watermelons' weights, and find they have a mean weight of 37 ounces. Assume the population standard deviation is 4.1 ounces. Based on this, what is the maximal margin of error associated with a 90% confidence interval for the true population mean watermelon weight.4. A student was asked to find a 99% confidence interval for widget width using data from a random sample of size n = 16. Which of the following is a correct interpretation of the interval 11.8 < < 20.4?A. There is a 99% chance that the mean of a sample of 16 widgets will be between 11.8 and 20.4.B. The mean width of all widgets is between 11.8 and 20.4, 99% of the time. We know this is true because the mean of our sample is between 11.8 and 20.4.C. With 99% confidence, the mean width of all widgets is between 11.8 and 20.4.D. With 99% confidence, the mean width of a randomly selected widget will be between 11.8 and 20.4.E. There is a 99% chance that the mean of the population is between 11.8 and 20.4. 5. For a confidence level of 90% with a sample size of 23, find the critical t value. A loan of 1000 has a compound interest rate of 2.7% charged monthly. Express the original loan as a percentage of the total amount awed after 2 months if no payment are made