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
MAVERICK [17]
2 years ago
14

Consider the function f(n) = n

Engineering
1 answer:
alexira [117]2 years ago
4 0

get off this

Explanation:

You might be interested in
Which two statements about professional technical jobs in the energy industry are correct?
Tanya [424]
The answer is both B and D
4 0
3 years ago
Read 2 more answers
The second programming project involves writing a program that accepts an arithmetic expression of unsigned integers in postfix
Tpy6a [65]

Answer:

Explanation:

Note: In case of any queries, just comment in box I would be very happy to assist all your queries

SourceCode:

// MyGUI.java:

// Import packages

import java.awt.FlowLayout;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

import java.util.EmptyStackException;

import java.util.Stack;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JOptionPane;

import javax.swing.JPanel;

import javax.swing.JTextField;

import javax.swing.SwingConstants;

// Declaare and define the class MyGUI

abstract class MyGUI extends JFrame implements ActionListener {

JTextField userInput;

JLabel inputDescLbl, resultLbl;

JPanel inputPanel, resultPanel;

JButton evlBtn;

Stack<Object> stk;

// Define the constructor MyGUI

MyGUI() {

super("Tree Address Generator");

inputPanel = new JPanel(new FlowLayout());

resultPanel = new JPanel(new FlowLayout());

setLayout(new GridLayout(2, 1));

userInput = new JTextField(20);

inputDescLbl = new JLabel("Enter Postfix Expression:");

evlBtn = new JButton("Construct Tree");

evlBtn.addActionListener(this);

resultLbl = new JLabel("Infix Expression:", SwingConstants.LEFT);

add(inputPanel);

add(resultPanel);

inputPanel.add(inputDescLbl);

inputPanel.add(userInput);

inputPanel.add(evlBtn);

resultPanel.add(resultLbl);

stk = new Stack<Object>();

}

}

//Stack.java:

// Declare and define the class Stack

class Stack {

private int[] a;

private int top, m;

public Stack(int max) {

m = max;

a = new int[m];

top = -1; }

public void push(int key) {

a[++top] = key; }

public int pop() {

return (a[top--]); }

}

// Declare and define the class Evaluation()

class Evaluation {

public int calculate(String s) {

int n, r = 0;

n = s.length();

Stack a = new Stack(n);

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

char ch = s.charAt(i);

if (ch >= '0' && ch <= '9')

a.push((int) (ch - '0'));

else if (ch == ' ')

continue;

else {

int x = a.pop();

int y = a.pop();

switch (ch) {

case '+':

r = x + y;

break;

case '-':

r = y - x;

break;

case '*':

r = x * y;

break;

case '/':

r = y / x;

break;

default:

r = 0;

}

a.push(r);

}

}

r = a.pop();

return (r);

}

}

// PostfixToInfix.java:

// Import packages

import java.util.Scanner;

import java.util.Stack;

// Declare and define the class PostfixToInfix

class PostfixToInfix {

// Determine whether the character entered is an operator or not

private boolean isOperator(char c) {

if (c == '+' || c == '-' || c == '*' || c == '/' || c == '^')

return true;

return false;

}

// Declare and define the convert()

public String convert(String postfix) {

Stack<String> s = new Stack<>();

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

char c = postfix.charAt(i);

if (isOperator(c)) {

String b = s.pop();

String a = s.pop();

s.push("(" + a + c + b + ")");

} else

s.push("" + c);

}

return s.pop();

}

// Program starts from main()

public static void main(String[] args) {

PostfixToInfix obj = new PostfixToInfix();

Scanner sc = new Scanner(System.in);

// Prompt the user to enter the postfix expression

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

String postfix = sc.next();

// Display the expression in infix expression

System.out.println("Infix : " + obj.convert(postfix));

}

}

Output:

e Console X terminated PostfixTolnfix [Java Application] C:\Program Files\Java\jrel.8.0_121\bin\javaw.exe Postfix : ABD++C-D/ .

3 0
3 years ago
Select four geometric shapes that are commonly used by engineers in their designs.
stealth61 [152]

Answer:

Arc ,sphere ,line ,prism

Explanation:

  • Arc is used for semicircular or short term projects
  • Sphere is used for design of spherical surfaces or projects
  • Prism is used for creating buliding designs
  • Lines are especially used for creating roads, flyover design
3 0
2 years ago
I. The time till failure of an electronic component has an Exponential distribution and it is known that 10% of components have
drek231 [11]

Answer:

(a) The mean time to fail is 9491.22 hours

The standard deviation time to fail is 9491.22 hours

(b) 0.5905

(c) 3.915 × 10⁻¹²

(d) 2.63 × 10⁻⁵

Explanation:

(a) We put time to fail = t

∴ For an exponential distribution, we have f(t) = \lambda e^{-\lambda t}

Where we have a failure rate = 10% for 1000 hours, we have(based on online resource);

P(t \leq 1000) = \int\limits^{1000}_0 {\lambda e^{-\lambda t}} \, dt = \dfrac{e^{1000\lambda}-1}{e^{1000\lambda}} = 0.1

e^(1000·λ) - 0.1·e^(1000·λ) = 1

0.9·e^(1000·λ) = 1

1000·λ = ㏑(1/0.9)

λ = 1.054 × 10⁻⁴

Hence the mean time to fail, E = 1/λ = 1/(1.054 × 10⁻⁴) = 9491.22 hours

The standard deviation = √(1/λ)² = √(1/(1.054 × 10⁻⁴)²)) = 9491.22 hours

b) Here we have to integrate from 5000 to ∞ as follows;

p(t>5000) = \int\limits^{\infty}_{5000} {\lambda e^{-\lambda t}} \, dt =\left [  -e^{\lambda t}\right ]_{5000}^{\infty} = e^{5000 \lambda} = 0.5905

(c) The Poisson distribution is presented as follows;

P(x = 3) = \dfrac{\lambda ^x e^{-x}}{x!}  = \frac{(1.0532 \times 10^{-4})^3 e^{-3} }{3!}  = 3.915\times 10^{-12}

p(x = 3) = 3.915 × 10⁻¹²

d) Where at least 2 components fail in one half hour, then 1 component is expected to fail in 15 minutes or 1/4 hours

The Cumulative Distribution Function is given as follows;

p( t ≤ 1/4) CDF = 1 - e^{-\lambda \times t} = 1 - e^{-1.054 \times 10 ^{-4} \times 1/4} = 2.63 \times 10 ^{-5}.

4 0
3 years ago
6.39 A particular machine part is subjected in service to a maximum load of 10 kN. With the thought of providing a safety factor
Serggg [28]

Answer:

2.275 %

Explanation:

see the attached picture for detailed answer.

8 0
3 years ago
Other questions:
  • An inflatable structure has the shape of a half-circular cylinder with hemispherical ends. The structure has a radius of 40 ft w
    6·1 answer
  • Determine displacement (in) of a 1.37 in diameter steel bar, which is 50 ft long under a force of 27,865 lb if elasticity modulu
    5·1 answer
  • Answer every question of this quiz
    7·1 answer
  • The solid cylinders AB and BC are bonded together at B and are attached to fixed supports at A and C. The modulus of rigidity is
    6·1 answer
  • For each topic, find the total number of blurts that were analyzed as being related to the topic. Order the result by topic id.
    6·1 answer
  • Early American rockets used an RC circuit to set the time for the rocket to begin re-entry after launch (true story). Assume the
    5·1 answer
  • If the surface energy of a magnesium oxide - nickel oxide (MgO-NiO) solid solution is 1.05 J/m2 and its elastic modulus is 198 G
    8·1 answer
  • Water flows with a velocity of 3 m/s in a rectangular channel 3 m wide at a depth of 3 m. What is the change in depth and in wat
    9·1 answer
  • Which rigid motion maps the solid-line figure onto the dotted-line figure?
    12·1 answer
  • Consider the function f(n) = n
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!