Skip to content

Commit

Permalink
Add a feature for Question/Answer from user
Browse files Browse the repository at this point in the history
  • Loading branch information
sinalalebakhsh committed Oct 28, 2023
1 parent 2b9e877 commit 5298149
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions features/Answers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type AllAnswers struct {

var Answers = AllAnswers{
SingleAnws: map[string]string{
"operator": "Hints and Tips Calculate the number of working cars produced per hour The percentage (passed as an argument) is a number between 0-100. To make this percentage a bit easier to work with, start by dividing it by 100. To compute the number of cars produced successfully, multiply the percentage (divided by 100) by the number of cars produced. When multiplying two numbers together, they both need to be of the same type. Use type conversions if needed.",
"operator 1": "Hints and Tips Calculate the number of working cars produced per hour The percentage (passed as an argument) is a number between 0-100. To make this percentage a bit easier to work with, start by dividing it by 100. To compute the number of cars produced successfully, multiply the percentage (divided by 100) by the number of cars produced. When multiplying two numbers together, they both need to be of the same type. Use type conversions if needed.",
},
}
6 changes: 6 additions & 0 deletions features/AnswersSample.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ type AnswersSampleStruct struct {

var AnswersSample = AnswersSampleStruct {
MapAnswersSample: map[string]string {
"operator": `// CalculateWorkingCarsPerHour calculates how many working cars are
// produced by the assembly line every hour.
func CalculateWorkingCarsPerHour(productionRate int, successRate float64) float64 {
last := float64(productionRate) * successRate / 100
return last
}`,
"operator 1": `// CalculateWorkingCarsPerHour calculates how many working cars are
// produced by the assembly line every hour.
func CalculateWorkingCarsPerHour(productionRate int, successRate float64) float64 {
Expand Down
1 change: 1 addition & 0 deletions features/Questions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type AllQuestions struct {

var Questions = AllQuestions{
SingleQues: map[string]string{
"operator":"The cars are produced on an assembly line. The assembly line has a certain speed, that can be changed. The faster the assembly line speed is, the more cars are produced. However, changing the speed of the assembly line also changes the number of cars that are produced successfully, that is cars without any errors in their production. Implement a function that takes in the number of cars produced per hour and the success rate and calculates the number of successful cars made per hour. The success rate is given as a percentage, Note: the return value should be a float64, from 0 to 100:",
"operator 1":"The cars are produced on an assembly line. The assembly line has a certain speed, that can be changed. The faster the assembly line speed is, the more cars are produced. However, changing the speed of the assembly line also changes the number of cars that are produced successfully, that is cars without any errors in their production. Implement a function that takes in the number of cars produced per hour and the success rate and calculates the number of successful cars made per hour. The success rate is given as a percentage, Note: the return value should be a float64, from 0 to 100:",
},
}
4 changes: 4 additions & 0 deletions features/QuestionsSample.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ type QuestionsSampleStruct struct {

var QuestionsSample = QuestionsSampleStruct {
MapQuestionsSample: map[string]string{
"operator":`Sample:
CalculateWorkingCarsPerHour(1547, 90)
expect:
// => 1392.3`,
"operator 1":`Sample:
CalculateWorkingCarsPerHour(1547, 90)
expect:
Expand Down

0 comments on commit 5298149

Please sign in to comment.