Create a user defined method named calcCost() that accepts two double values as input (length and width), and then computes the estimated cost of painting a room (walls only, not ceiling), assuming the room is rectangular and has four full walls and the walls are 2.6 meter high. The rate for the painting job is R20 per square meter. Your method should return the estimated cost to the calling method. Create a program whose Main() method prompts a user for the length and the width of a room in meter, then calls calcCost to calculate the estimated cost. Once calculated, you should display the estimated cost.
Write a program that prompts the user for the following values: nickname and favourite movie/series. Write a user defined method named displayDetails() that accepts two string values as input, and then displays these values. Add the required instructions to your Main() program to allow it to display the text Hello World and then calls the displayDetails() method to display your information.
Number of moves:
you are given a nxn square chessboard with one bishop and k number of obstacles placed on it. A bishop can go to different places in a single move. find the total no.of places that are possible for the bishop in a single move. Each square is referenced by a type describing the row, R, and column, C, where the square is located.
explanation: given N=6 K=2
bishop position 5 2
obstacle positions (2 2), (1 5)
the bishop can move in so o/p is 6
I/p:
6 2
5 2
2 2
1 6
O/p:
6
I/p:
6 4
3 3
1 3
3 1
5 1
1 5
O/p: 7
Dice Score:
two friends are playing a dice game, the game is played with five six-sided dice. scores for each type of throws are mentioned below.
three 1's = 1000 points
three 6's = 600
three 5's = 500
three 4's = 400
three 3's = 300
three 2's = 200
one 1 = 100
one 5 = 50
I/p: 2
1 1 1 1 1
6 6 6 1 5
O/p: 1200
750
I/p: 2
2 1 5 2 2
1 1 1 2 2
O/p: 350
1000
Pager:
Imagine a paper with only one button. for the letter "A", you press the button one time, for "B", you press it 2 times for "E", you press it five times. for "G", it's pressed seven times, etc.
Given a string s, print the total number of times the button should be pressed
explanation: given string is abde. then the total no. of times the button pressed is 1+2+4+5=12
I/p: abde
O/p: 12
I/p: xyz
O/p: 75
given a matrix of M rows & N columns, you need to find the smallest number in each row & print the sum of the smallest numbers from all rows.
explanation: M=3. given matrix is
1 2 3
4 5 6
7 8 9
the minimum elements of each row 1, 4, 7 => sum is 1+4+7=12
I/p: 3 3
1 2 3
4 5 6
7 8 9
O/p: 12
I/p: 2 3
0 12 -13
-10 0 10
O/p: -23
Q: Formal methods are related to both defect prevention and defect detection removal. Discuss other QA activities that cut across multiple categories in our classification of QA activities into defect prevention, reduction, and containment.
Subject/Course: Software Quality Engineering
Write a code to find unique number of vowel in str
Explain what is meant by the syntax and the semantics of a programming language. Give Java examples to illustrate the difference between a syntax error and a semantics error.
Despite being adjacent in a protocol stack, Data Link Layer protocols and Network Layer protocols each employ a number of similar fields in their headers (i.e. a field named 'X' appears in the headers of both layers, and the role of 'X' is similar for both layers).
For each of these three fields:
a. describe its typical role, and
b. provide an example to demonstrate why their 'duplication' does not introduce unnecessary redundancy.